Skip to content

Commit

Permalink
completed showing/hiding of list and renamed file
Browse files Browse the repository at this point in the history
  • Loading branch information
hirthy committed Jan 19, 2012
1 parent f81fa30 commit a54fd86
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
13 changes: 0 additions & 13 deletions scripts/datagrabber.js

This file was deleted.

23 changes: 23 additions & 0 deletions scripts/showlist.js
@@ -0,0 +1,23 @@
$(document).ready(function() {
// how many results to display at a time
var step = 5;

// shows next x items in list, where x is the step size
function showNext(list) {
var current = list.children(':visible').length;
list
.find('li:lt(' + (current + step) + ')')
.slideDown();
}

// show initial set
$.each($('ul'), function(index) {
showNext($(this));
});

// clicking on the 'load more' link:
$('.more').click(function(e) {
e.preventDefault();
showNext($(this).siblings('ul'));
});
});

0 comments on commit a54fd86

Please sign in to comment.