diff --git a/sandbox/insert.html b/sandbox/insert.html
index 3647c88..b13af5b 100644
--- a/sandbox/insert.html
+++ b/sandbox/insert.html
@@ -12,7 +12,11 @@
49
@@ -60,8 +64,13 @@ docReady( function() {
}
});
+ eventie.bind( document.querySelector('#prepend'), 'click', function() {
+ // prepend 3 new items
+ iso.prepended( [ prependItem(), prependItem(), prependItem() ] );
+ });
+
eventie.bind( document.querySelector('#insert'), 'click', function() {
- // append 3 new items
+ // insert 3 new items
iso.insert( [ getItem(), getItem(), getItem() ] );
});
@@ -78,6 +87,12 @@ docReady( function() {
return item;
}
+ function prependItem() {
+ var item = getItem();
+ container.insertBefore( item, container.firstChild );
+ return item;
+ }
+
function appendItem() {
var item = getItem();
container.appendChild( item );
@@ -95,8 +110,6 @@ var getText = docElem.textContent ?
function( elem ) {
return elem.innerText;
};
-
-