I found a solution to my problem. It didn't work because there was
calling $(element).prettyPhoto more than once on a page.
I changed jquery.prettyPhoto.js from
if($('.pp_overlay').size()==0) _buildOverlay(); // If the overlay is not there, inject it!
// Global variables accessible only by prettyPhoto
var doresize = true, percentBased = false, correctSizes,
// Cached selectors
$pp_pic_holder, $ppt, $pp_overlay,
// prettyPhoto container specific
pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
to
// Cached selectors
var $pp_pic_holder, $ppt, $pp_overlay;
if($('.pp_overlay').size()==0) {
_buildOverlay(); // If the overlay is not there, inject it!
} else {
// ensure the cached selectors are initialized
$pp_pic_holder = $('.pp_pic_holder');
$ppt = $('.ppt');
$pp_overlay = $('div.pp_overlay');
}
// Global variables accessible only by prettyPhoto
var doresize = true, percentBased = false, correctSizes,
// prettyPhoto container specific
pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
Fessss
Member
4 Points
2 Posts
Re: UpdatePanel Problem. Javascript not firing after asyncronous postback
Mar 10, 2010 10:42 AM|LINK
I found a solution to my problem. It didn't work because there was calling $(element).prettyPhoto more than once on a page.
I changed jquery.prettyPhoto.js from
if($('.pp_overlay').size()==0) _buildOverlay(); // If the overlay is not there, inject it! // Global variables accessible only by prettyPhoto var doresize = true, percentBased = false, correctSizes, // Cached selectors $pp_pic_holder, $ppt, $pp_overlay, // prettyPhoto container specific pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,to
// Cached selectors var $pp_pic_holder, $ppt, $pp_overlay; if($('.pp_overlay').size()==0) { _buildOverlay(); // If the overlay is not there, inject it! } else { // ensure the cached selectors are initialized $pp_pic_holder = $('.pp_pic_holder'); $ppt = $('.ppt'); $pp_overlay = $('div.pp_overlay'); } // Global variables accessible only by prettyPhoto var doresize = true, percentBased = false, correctSizes, // prettyPhoto container specific pp_contentHeight, pp_contentWidth, pp_containerHeight, pp_containerWidth,
Thanks.
http://forums.no-margin-for-errors.com/comments.php?DiscussionID=323