dokukinopio
Member
Posted 1 year ago #
Hi, nice plugin.
I'm trying to use it with posts i've been loading using this technique:
http://www.emanueleferonato.com/2010/04/01/loading-wordpress-posts-with-ajax-and-jquery/
So it works fine for posts on my frontpage (normally loaded) but not with the posts that I load with ajax and insert into the innerhtml of a div on my page. They do have the fancy-gallery classes and so on, but I guess their event handlers aren't hooked up.
So my question is, is it possible to re-run the event-handler initialization code (or however it works) for the fancy gallery? Because then I think I could load my posts from ajax, invoke the event-handler hooking up code, and be happy.
Thanks in advance~
http://wordpress.org/extend/plugins/fancy-gallery/
This is a nice tip. I will see how I could add support for Ajax interfaces. To make it work for now you could try to re-fire the jQuery "ready" event.
You could try
jQuery(document).ready();
after you loaded the posts content or you could try
jQuery(document).trigger('ready');
Sergey.S.Betke
Member
Posted 1 year ago #
Author: Thank you very much for your plugin. I ask you to add the ability to use your plugin for AJAXed sites. The following quote a modified version of the file fancy-js.php. In the beginning of the file - patch for support client-side caching (also ask you to include these changes in the next version of your plugin). At the end of the file - a subscription to an update AJAX event. Using the event "ready" will cause the processing of the document (that too), except that - will work and those handlers that should work only when document loaded. This is potential bag.
AJAX loader just fire event:
$(el).trigger('onContentUpdate.ajax');
and Your plugin prepare just loaded (updated) content, not full document.
fancy-js.php for AJAX:
[Code moderated as per the Forum Rules. Please use the pastebin]