WordPress.org

Support

Support » Plugins and Hacks » Photoswipe for NextGEN Gallery » bug with disable fancybox option and better mobile detection

bug with disable fancybox option and better mobile detection

  • hello,

    nice plugin tanks!
    there is a little bug with the option -> disable fancybox
    the checkbox does not work: dont stay checked when you come back in the option page, and every time you load the page option -> option is reset to false.
    solution:
    in ngg-photoswipe.php, put the update_option in the if ($_REQUEST[‘nggphotoswipe_enabled’]) on line 73

    if ($_REQUEST['nggphotoswipe_enabled']) {
      update_option('nggphotoswipe_enabled',$_REQUEST['nggphotoswipe_enabled']		;
      update_option('additional_viewers',$_REQUEST['additional_viewers']);
    }

    and i think you can use the wordpress function wp_is_mobile() for detection, so you dont need to update your code -> $isMobile 😉

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

Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi, Tribalpixel. Thanks for the code fix, but the first update_option seems to be missing a closing parenthesis just before the semicolon. Second, I made the changes (including setting $isMobile to wp_is_mobile()), but the Disable Fancybox option still doesn’t stay checked. Is there something else that needs to be done?

    I’ve found that Fancybox isn’t being disabled. It still comes up in the background, and while you can’t see the Fancybox frame, the semi-transparent overlay from Fancybox covers up the PhotoSwipe, and I have to tap on it to clear it before I can reach PhotoSwipe.

    Same problem here! Is the code fixed yet?

    same here!

    +1 (or more for each site I’d like to implement this on)

    I have tried editing/adding more “unbind” attempts to the plug-in code, but cannot get this plug-in to disable fancybox no matter what we try. quite frustrating.

    Seriously is this issue ever going to get some support?

    It’s very frustrating.

    To the frustrated masses – I went with a plug-in called WP Jaipho. Little bit different interface and has some css bugs on ipad landscape mode, but it works with NGG and disables fancybox properly out of the box.

    wilbur07

    @wilbur07

    I corrected the disable fancybox issue. First use tribalpixel’s code fix of putting 2nd update_option INSIDE if brackets above it.
    Then, on line 3 of ngg-photoswipe-disable-fancybox.js in the js folder in the photoswipe plugin folder, add or replace this line:
    jQuery('a.fancybox').unbind('click.fb').addClass('nolightbox').removeClass('fancybox');

    with:

    jQuery('a.ngg-fancybox').unbind('click.fb').addClass('nolightbox').removeClass('ngg-fancybox');

    because nextgen uses ngg-fancybox as a triggering class not the normal fancybox class.

    stealthkinetics

    @stealthkinetics

    I’ve got easy fancybox installed too and it does appear to use the normal fancybox class. I can’t get it to work no matter what I’ve tried, the ‘disable fancybox’ checkbox never stays checked.

    Back to jaipho for now

    Im seeing an interesting issue. Im using easyfancybox and when checking the tickbox to remove the fancy box class I can see the class being added “nolightbox” but it fails to remove the “fancybox” in the class.

    The no lightbox class does not do anything for me, its the removal of the fancybox that will disable the fancybox. (tested it dev tools)

    I have trippled checked that the “fancybox” class is spelt correctly, im really not sure why it cannot remove the class but can add the “nolightbox” class.

    Ive been testing recommended solutions on this page and on this thread. http://wordpress.org/support/topic/plugin-photoswipe-for-nextgen-gallery-using-fancybox-for-wordpress-plugin-with-photoswipe

    Let me know if you have any ideas…

    Worked out what my issue was.

    It was apparent that there was 2 places that fancybox class was being added to the thumbnail link.

    Place 1 – in the nextgen gallery where it asked to add the custom code
    place 2 – in the fancy box setting that had images checked as default

    So to fix this either have place 1 or 2 and dont have both.

    ashrodan i have solved this issue.

    … on line 3 of ngg-photoswipe-disable-fancybox.js in the js folder in the photoswipe plugin folder, add or replace this line:
    jQuery('a.fancybox').unbind('click.fb').addClass('nolightbox').removeClass('fancybox');

    with:

    jQuery('a.ngg-fancybox').unbind('click.fb').addClass('nolightbox').removeClass('ngg-fancybox');

    because nextgen uses ngg-fancybox as a triggering class not the normal fancybox class.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘bug with disable fancybox option and better mobile detection’ is closed to new replies.
Skip to toolbar