FancyBox for WordPress
[resolved] Fancybox for WordPress and Infinite scroll (2 posts)

  1. stephani.vigil3
    Posted 4 years ago #

    Can't seem to get fancybox to open up after the first page with infinite scroll enabled.

    Anyone else ever come across this?



  2. stephani.vigil3
    Posted 4 years ago #

    Okay, I put it together.

    If it helps anyone else, here's the script:

    <script type="text/javascript" src="<?php bloginfo('template_url'); ?>/libs/jquery.infinitescroll.min.js"></script>
    <script type="text/javascript">
    var href = 'first';
    jQuery(document).ready(function($) {
    		$("a[rel=lightbox], a[rel=lightboxTitle], a[rel=lightboxMore], a[rel=prev], a[rel=next]").live('click', function(){
    'type': 'ajax',
    'hideOnOverlayClick': true,
    'showNavArrows': true,
    'href': $(this).attr('href')
     return false;
    		navSelector : '.infinitescroll',
    		nextSelector : '.infinitescroll a',
    		itemSelector : '#boxes .box',
    		loadingImg : '<?php bloginfo('template_url'); ?>/images/loading.gif',
    		loadingText : 'Loading...',
    		donetext : 'No more pages to load.',
    		debug : false
    		}, function(arrayOfNewElems) {
    		$('#boxes').masonry('appended', $(arrayOfNewElems));
    		if (href != $('.infinitescroll a').attr('href'))
    			href = $('.infinitescroll a').attr('href');
    		function() { window.setTimeout(infinite_scroll_callback(), 1); } );

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • FancyBox for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic