javascript - Masonry + Infinite Scroll and PrettyPhoto Lightbox -
this re-post, i'm using masonry plugin infinite-scroll plugin on wordpress blog. need utilize prettyphoto plugin on blog. prettyphoto lightbox working fine, when masonry loads next set of posts (infinite scroll plugin loads next set of post when scroll down), prettyphoto stops working. note: theme utilize has embedded lightbox i'm not expert in jquery so, here's 2 scripts utilize on theme https://dl.dropbox.com/u/89122367/plugins.js https://dl.dropbox.com/u/89122367/scripts.js need utilize prettyphoto on theme, need help experts
the reason why it's not working prettyphoto
don't know there new images "take care of" :) . when new items uploaded, dont't have prettyphoto
bind
. think, easiest way add together detection of ajax request , fire prettyphoto
on new images.
$(document).ajaxcomplete(function() { $("a[rel^='prettyphoto']").prettyphoto(); // or other way utilize prettyphoto });
put abowe code head section of page, ie:
<script> $(document).ajaxcomplete(function() { $("a[rel^='prettyphoto']").prettyphoto(); // or other way utilize prettyphoto }); </script>
this should help you
javascript ajax jquery
No comments:
Post a Comment