I've created a dropdown menu that has different locations as options. When one of the links is clicked, the content from the respective post is loaded asynchronously via AJAX. I followed this tutorial to pull it off.
So I have a native Wordpress gallery set up in each of the location posts and I'm using a Colorbox plugin for a lightbox effect. when I go directly to the post, the lightbox works as intended. However, when the gallery is loaded on a separate page via AJAX, the photos appear but the lightbox does not work.
I think the problem might be in the AJAX call I'm using...
here's the JS:
(function($) {
$(document).ready(function(){
$.ajaxSetup({cache:false});
$("#location").click(function(){
$("div.dropdown").addClass("open");
});
$("a.loc-dd").click(function(){
$("#location").html($(this).html());
var post_id = $(this).attr("rel")
$("#pricing-container").append("<div class='loader'></div>");
$("#pricing-container").load("http://<?php echo $_SERVER[HTTP_HOST]; ?>/wp/pricing/",{id:post_id});
return false;
});
});
})(jQuery);