I have this code :
Place this somewhere it is executed when the DOM is ready, but before the click event handlers are added.
//How many pages do we want?
elementCount = $('.line-content').size();
pageCount = Math.ceil(elementCount / pageSize);
//Add the buttons.
buttons = '';
for(i=1; i<=pageCount; i++) {
buttons += '- ' + i + '
');
}
$('#pagin').html(buttons);
Then you can just leave #pagin
empty and the JavaScript will fill it for you:
Disclaimar: I haven't tested this code.