Lightbox no longer works after jQuery pagination is triggered
We are using two scripts at the same time: prettyPhoto and jQuery pagination. When the page first loads, both of the scripts are working. However, when I click on Page 2 of the pagination, the lightbox no longer shows but I can still go from one page to the next. These are the initialization scripts for both:
jQuery Pagination:
Code:
<script type="text/javascript">
// This is a very simple demo that shows how a range of elements can
// be paginated.
// The elements that will be displayed are in a hidden DIV and are
// cloned for display. The elements are static, there are no Ajax
// calls involved.
/**
* Callback function that displays the content.
*
* Gets called every time the user clicks on a pagination link.
*
* @param {int} page_index New Page index
* @param {jQuery} jq the container with the pagination links as a jQuery object
*/
function pageselectCallback(page_index, jq){
var new_content = jQuery('#hiddenresult div.result:eq('+page_index+')').clone();
$('#Searchresult').empty().append(new_content);
return false;
}
/**
* Initialisation function for pagination
*/
function initPagination() {
// count entries inside the hidden content
var num_entries = jQuery('#hiddenresult div.result').length;
// Create content inside pagination element
$("#Pagination").pagination(num_entries, {
callback: pageselectCallback,
items_per_page:1 // Show only one item per page
});
}
// When document is ready, initialize pagination
$(document).ready(function(){
initPagination();
});
</script>
prettyPhoto:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
</script>
Anyone knows where the conflict lies? Thanks.
2 Attachment(s)
prettyPhoto popup numbering of images and pages problem
I have similar problem and want to ask if this solve a problem with numbering of images in PrettyPhoto popup window. Now i use the same libraries (prettyPhoto, jquery_pagination ) to show thumbnails on few pages with 6 images on each. And when i click on page 2 (for example) and open first image in prettyPhoto popup numbering of images starts from 1 instead of 7.
Here is a simple screenshot.
Attachment 5119Attachment 5120
It seems the re initializing of prettyphoto reset counter and i don't know how to fix this :confused:
Thanks in advance.