Grow your CSS skills. Land your dream job.

Help with WordPress ajax and fancybox.

  • # June 10, 2013 at 5:55 pm

    Can some please troubleshoot this. My fancybox script doesnt work unless I refresh the page. There are no errors in console.

    http://rgfx.net/sports/?page_id=13

    The two scripts that I used to reload here.

    214-246 http://rgfx.net/sports/,wp-content/themes/sports/library/js/scripts.js

    function addPhotoSwipe(){
    if(typeof jQuery(".ngg-gallery-thumbnail a").photoSwipe == 'undefined' ){
    jQuery(document).ready(function() {
    images = jQuery('a.myfancybox')

    if( typeof jQuery(images).fancybox != 'function' || images.length == 0 ){
    jQuery('#fancybox-wrap').css('display', 'none');
    return;
    }


    jQuery(images).fancybox({ 'zoomSpeedIn':500, 'zoomSpeedOut':500, 'overlayShow':true, 'overlayOpacity':0.3 });
    });

    http://www.rgfx.net/sports/wp-content/plugins/advanced-ajax-page-loader/ajax-page-loader.js lines 545-556

    	jQuery('#' + AAPL_content).fadeIn("slow", function() {
    addPhotoSwipe();
    var menulink = document.getElementsByClassName('menu-link')[0];
    jQuery('html, body').animate({
    'scrollTop' : menulink.offsetTop
    })
    });
    addMasonry();
    addJcp();
    addPhotoSwipe();
    }

    So close, just one fix and this project is finished, please just take a look.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".