Can someone help me please? I have little knowledge of JS... I tried this example, that brianpeiris wrote.. It worked nicely, but I need two different pagers in the same page. How can I accomplish this?
This code doesn't work, but this is how far I got..
<script type="text/javascript">
var pagination_options = {
num_edge_entries: 1,
num_display_entries: 8,
callback: pageselectCallback,
items_per_page:1
}
function pageselectCallback(page_index, jq){
var items_per_page = pagination_options.items_per_page;
var offset = page_index * items_per_page;
var new_content = $('#hiddenresult div.result').slice(offset, offset + items_per_page).clone();
$('#Searchresult').empty().append(new_content);
var items_per_page = pagination_options.items_per_page;
var offset = page_index * items_per_page;
var new_content = $('#hiddenresult2 div.result2').slice(offset, offset + items_per_page).clone();
$('#Searchresult2').empty().append(new_content);
return false;
}
function initPagination() {
var num_entries = $('#hiddenresult div.result').length;
// Create pagination element
$("#Pagination").pagination(num_entries, pagination_options);
num_entries = $('#hiddenresult2 div.result2').length;
// Create pagination element
$("#Pagination2").pagination(num_entries, pagination_options);
}
$(document).ready(function(){
initPagination();
});