Support » Plugin: Photoswipe for NextGEN Gallery » [Plugin: Photoswipe for NextGEN Gallery] Using Fancybox for WordPress plugin with Photoswipe.

  • Resolved Paul

    (@paulcass82)


    I am currently using the Fancybox for WordPress plugin with the NextGEN Gallery plugin on my site and it works great. However when browsing my site on a mobile device and I click on an image the fancybox modal window appears and then the photoswipe gallery loads on top of this. If I use the default ‘shutter’ effect without fancybox for the NextGEN gallery everything works fine but I would really like to use fancybox as it looks much nicer. Any ideas how to disable fancybox for mobile devices? Thank you in advance.

    http://wordpress.org/extend/plugins/photoswipe-for-nextgen-gallery/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Guillermo

    (@gsenas)

    Send me an URL that uses Fancybox + NextGEN and I’ll give it a try.

    Paul

    (@paulcass82)

    Thanks for the prompt reply. Below is a link to the test site I am working on.

    My Test Site

    Plugin Author Guillermo

    (@gsenas)

    Try this:

    In my plugin, edit ngg-photoswipe.js, and replace this:

    jQuery(document).ready(function(){
    	//Remove thickbox effect:
    	jQuery('a.thickbox').removeClass ("thickbox");
    	//Remove lightbox effect:
    	jQuery('a[rel^="lightbox"]').attr("rel","");
    	//Remove highslide effect:
    	jQuery('a.highslide').removeClass("highslide").attr("onclick","");
    	//Remove shutter effect:
    	jQuery('a[class^=shutterset]').removeClass (function (index, css) { return (css.match (/\bshutterset\S+/g) || []).join(' '); });
    });

    with this:

    jQuery(document).ready(function(){
    	//Remove thickbox effect:
    	jQuery('a.thickbox').removeClass ("thickbox");
    	//Remove lightbox effect:
    	jQuery('a[rel^="lightbox"]').attr("rel","");
    	//Remove highslide effect:
    	jQuery('a.highslide').removeClass("highslide").attr("onclick","");
    	//Remove shutter effect:
    	jQuery('a[class^=shutterset]').removeClass (function (index, css) { return (css.match (/\bshutterset\S+/g) || []).join(' '); });
    	//Remove fancybox effect:
    	jQuery('a.fancybox').unbind('click.fb').removeClass('fancybox');
    });

    Let me know if it works.

    Paul

    (@paulcass82)

    Hi gsenas. Sorry that didn’t seem to work I have tried clearing the cache etc too just in case but the problem is still there 🙁

    Plugin Author Guillermo

    (@gsenas)

    Put my plugin in “Always replace viewer with Photoswipe” mode in your test page and I’ll try to find what’s wrong.

    Paul

    (@paulcass82)

    Ok I’ve done this now thanks.

    Plugin Author Guillermo

    (@gsenas)

    Try this code:

    jQuery(document).ready(function(){
    	//Remove thickbox effect:
    	jQuery('a.thickbox').removeClass ("thickbox");
    	//Remove lightbox effect:
    	jQuery('a[rel^="lightbox"]').attr("rel","");
    	//Remove highslide effect:
    	jQuery('a.highslide').removeClass("highslide").attr("onclick","");
    	//Remove shutter effect:
    	jQuery('a[class^=shutterset]').removeClass (function (index, css) { return (css.match (/\bshutterset\S+/g) || []).join(' '); });
    	//Remove fancybox effect:
    jQuery('a.fancybox').unbind('click.fb').addClass('nolightbox').removeClass('fancybox');
    });
    Paul

    (@paulcass82)

    Sorry still no luck. This might have nothing to do with it but I’ve just realised when editing ngg-photoswipe.js is has (inactive) next to it. Is that just because I’m not viewing on a mobile device? I’m just wondering whether the ngg-photoswipe.js is being initialised before the fancybox js file so you could be trying to remove a class (.fancybox) before it’s even been added to the anchor. Sorry I’m a beginner please tell me if this makes no sense.

    Plugin Author Guillermo

    (@gsenas)

    What you’re saying not only makes sense, it’s exactly the approach I’m using to prevent Fancybox from launching.

    By the way, I’ve just tested your site and now it works: Fancybox doesn’t launch.

    Have you tried clearing your cache?

    Plugin Author Guillermo

    (@gsenas)

    So, did it work?

    Paul

    (@paulcass82)

    Yes thank you so much 🙂 Will this change be built in to the next update?

    Plugin Author Guillermo

    (@gsenas)

    I’ll think about it, but I’m still not sure.

    After all, Fancybox is not built-in with NextGEN Gallery.

    Anyway, why don’t you rate the plugin?

    Paul

    (@paulcass82)

    Yes I see your point but I would of thought there will be quite a few people that would benefit from this also. Obviously this is totally up to you and at least you have given me a workaround 🙂 Thanks again and yes I shall be giving it a 5 star rating!

    Plugin Author Guillermo

    (@gsenas)

    Check the latest version 😉

    Paul

    (@paulcass82)

    Great thanks 🙂 At least now this means I won’t have to keep updating the JavaScript with the fix. Keep up the good work!

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘[Plugin: Photoswipe for NextGEN Gallery] Using Fancybox for WordPress plugin with Photoswipe.’ is closed to new replies.