Easy FancyBox
Easy fancybox not working when content is loaded via AJAX (2 posts)

  1. brianeoneill
    Posted 4 years ago #

    Hi there.

    I'm using AJAX on my site to load in divs that contain thumbnails to FancyBox galleries. When viewed in their "natural state" the links open up a FancyBox gallery with no problem.

    However, when the div that contains these thumbnails is loaded onto a page via AJAX (using jQuery's .load() method), the effect stops working.

    Not sure if that's making sense, so here's a link to the site I'm creating (it's still in progress): http://ecbiz119.inmotionhosting.com/~fullbo6/ If you click "photos", the images are supposed to open up a gallery.

    If you go directly to http://ecbiz119.inmotionhosting.com/~fullbo6/photos/ the images open the gallery with no problem.

    I'm guessing it has something to do with other JavaScript on the home page, but I've googled and firebugged and read and checked all my functions, and I'm ready to bang my head against the !@#@$%%^* wall.

    Any thoughts?

    Thanks in advance!


  2. RavanH
    Plugin Author

    Posted 4 years ago #

    Hi, yes: loading content via ajax does indeed circumvent the attachment of FancyBox to any links in that new content.http://aufildudoux.fr/wp-admin/network/update-core.php

    You'd need either to re-fire the document ready event after new content has been loaded, or create a new event that the fancybox script can be bound to (for this, you will need the development version of Easy FancyBox and then customise it a tiny bit)...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic