WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Apply Easy FancyBox to reloaded NextGen Tag Gallery (3 posts)

  1. Joe777
    Member
    Posted 1 year ago #

    The new Easy FancyBox update broke my web page, so I reverted to the previous version. I'm hoping to get some help making the new version work.

    My usage of Easy FancyBox is probably unusual, so I'm not surprised the new version broke it, especially since the software has been refactored in the new update. In my page I load a new NextGen tag gallery without reloading the entire page. To make this work, I first used PHP to call the NextGen php function that creates the tag gallery. Once that's on the page, I used another PHP to call the function 'easy_fancybox()'. I must admit I called the 'easy_fancybox()' function without completely understanding it, except I know that it worked.

    The easy_fancybox() function no longer exists in the refactored Easy FancyBox software. I tried calling easyFancyBox::main_script() instead, but that got in an endless loop. I know it's an endless loop by seeing two things: 1) on the web page the 'waiting' animation never ends, 2) I used Xdebug to set a breakpoint and step through the main_script() code, and it's stuck in a loop.

    Here is a link to my sight that uses the PHPs I described above: http://www.thelesters.net/tag-gallery-page/. Of course this has the old Easy FancyBox code that still works. Here is a link to a post that very briefly describes in more detail than above what I did: http://www.thelesters.net/2013/wordpress-tag-gallery-page-plugin-using-jstree-and-nextgen-gallery/

    Thanks!

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

  2. RavanH
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Joe, to make FancyBox work with (or rather: recognize) images that are loaded after document.ready, which I believe you are doing, there is a new method in 1.5.0 : the handler 'easy_fancybox_handler' will respawn the main javascript function.

    Quickly scanning your code, I notice you are calling tgp2_ProcessThumbGet after new images are loaded, correct? Could you try replacing that with easy_fancybox_handler ?

    If that does not work (produces errors) then you could just do this in your tgp2_ProcessThumbGet function:

    jQuery(document).trigger('gform_post_render');

    In any case, you should not need to call any fancybox php files after each ajax load anymore.

  3. Joe777
    Member
    Posted 1 year ago #

    Hi Ravan,

    That did it! Thanks so much for your help! I didn't exactly replace tgp2_ProcessThumbGet with easy_fancybox_handler because I need to do some other things besides calling easy_fancybox_handler (e.g. change the navigation between thumbnail pages). Instead, I just put easy_fancybox_handler in the tgp2_ProcessThumbGet, got rid of the klugey php call, and moved the navigation manipulating code into tgp2_ProcessThumbGet.

    Thanks for your great plug-in, and for the support.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic