WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. stephani.vigil3
    Member
    Posted 2 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?

    Thanks

    http://wordpress.org/extend/plugins/fancybox-for-wordpress/

  2. stephani.vigil3
    Member
    Posted 2 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(){
     $.fancybox({
    'type': 'ajax',
    'hideOnOverlayClick': true,
    'showNavArrows': true,
    'href': $(this).attr('href')
     });
     return false;
    });
    		$('#boxes').infinitescroll({
    		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); } );
    
        });
    </script>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic