Skip to content

Instantly share code, notes, and snippets.

@sinky
Created November 6, 2012 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinky/4026000 to your computer and use it in GitHub Desktop.
Save sinky/4026000 to your computer and use it in GitHub Desktop.
Initially show only X table rows
var numShown = 15; // Initial rows shown & index
// Hide rows and add clickable div
$('.cinematiclist').find('tr:gt(' + (numShown - 1) + ')').hide().end().append('<tr id="cinematicmore"><td colspan="4" style="cursor:pointer; text-align:center;">Zeige alle</td></tr>');
// onclick remove trigger an show full table
$('#cinematicmore').click(function(){
$('#cinematicmore').remove();
// Show all
$('.cinematiclist').find('tr').show();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment