jQuery each_slice Plugin Demos
Click the button below to separate out the list elements below into columns with 3 list items each.
- one
- two
- three
- four
- five
- six
- seven
- eight
- nine
The demo code
Here is the code used for the demo.
jQuery(function($) {
$('#each_sliceExampleButton').bind('click', function(event) {
$('#each_sliceExample')
.find('li')
.each_slice(3, function() {
$('<ul />').append(this).appendTo('#each_sliceExample');
})
.end()
.find('ul:first').remove(); // remove old ul
$(this).remove();
});
});