Links loaded through Ajax plugin don't get a lightbox
-
I am trying to use wp_video_lightbox in conjuction with AjaxLoadMore. Video links at the top of the page work fine with a lightbox. However, videos links in content loaded through AJAX simply go through to YouTube. You can see the result here: http://www.thermocow.com
It’s sounds like the same problem as https://wordpress.org/support/topic/links-loaded-from-ajax
However, the solution in that post isn’t working for me. If I add that javascript code to the end of alm_query_posts() in the AjaxLoadMore script, the script just hangs.
More specifically, if I use the following code, it hangs inside prettyPhoto():
var elems = document.getElementsByTagName("a"); for ( var i = 0; i < elems.length; i += 1 ) { if ( elems[i].hasAttribute("rel") && elems[i].getAttribute("rel") == "AJAX-wp-video-lightbox" ) { elems.prettyPhoto(); } }
Any suggestions for what I might be doing wrong?
Thanks
- The topic ‘Links loaded through Ajax plugin don't get a lightbox’ is closed to new replies.