Support » Plugins and Hacks » [Resolved] Apply Easy FancyBox to reloaded NextGen Tag Gallery

[Resolved] Apply Easy FancyBox to reloaded NextGen Tag Gallery

  • 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/



Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author RavanH


    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:


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

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] Apply Easy FancyBox to reloaded NextGen Tag Gallery’ is closed to new replies.