My jQuery .click functions are not working on content that is loaded with ajax. I changed my .click to .on ("click") functions because I read that event delegation would fix the problem. Here is my ajax call:
$(".piece:nth-child(1)").click(function() {
$.ajax({
url: "terra.html",
datatype: "html",
async: false,
success: function(data) {
$("body").fadeOut(function() {
$(this).html(data).slideDown(500);
});
}
});
});
And this is the function that is not working after the ajax call:
$(document).on('click', ".pin", function() {
$(this).css("z-index", "99");
$(".dropdown-container").animate({"top": "0px"}, 500, "ease");
$(".terra-arrow-dropdown").show();
$(".interact .terra-arrow").fadeOut(300);
$(".interact .screen").addClass("screen-opacity");
});
terra.html?