Using fancybox for future items?

Can fancybox (or any lightbox alternative) be applied to elements loaded by loading hquery ()? If so, how?

+2


a source to share


2 answers


Assuming you are loaded, the elements are classified as "loadElement"

$(".loadedElement").live("load", function() {
    // Implement lightbox code
});

      



Or, if you want to implement this lightbox before the images have finished loading, change "load" to "ready"

+5


a source


Check jQuery Live to bind to elements added by jQuery.



Description: Attach a handler to the event for all elements that match the current selector, now or in the future.

+2


a source







All Articles