0.7.1 • Published 11 years ago
dom-queue v0.7.1
dom-queue
A queue for the DOM. Not really a queue, but whatevs.
Example
var Queue = require('dom-queue');
var q = Queue({container: 'some-list'});
q.push('a');
q.push('b');
q.push('c');Outputs:
<ul class="some-list">
<li class="item">a</li>
<li class="item">b</li>
<li class="item">c</li>
</ul>Queue
var q = Queue(options={})
options consist of:
containerdefault:queuetagdefault:ulparentdefault:bodychildTagdefault:liif parent isul.spanotherwise.
q.push(item)
Push an item onto the queue.
q.pop()
Remove the last item that was pushed.
q.shift()
Remove the first item.
q.remove(index)
Remove the item where index is in the list.
q.clear()
Clears items in the queue, but leaves the container.
