I have two click functions that seem to be firing at the same time. I need the second to only happen after the first.
So the first slideDown is working fine but once that has finished I want it to stop, and then the slideUp to happen own the .close class is clicked.
$(".trigger").click(function() {
$(".mobileWrap").slideDown(500);
$(".mainContentBg").addClass("height", 1000);
$(".trigger").text("Read less");
$(".trigger").addClass("close");
$(".close").removeClass("trigger");
});
$("body").on("click", ".close", function() {
$(".mainContentBg").removeClass("height", 1000);
$(".mobileWrap").slideUp(1000);
$(".trigger").addClass("trigger");
$(".trigger").text("Read more");
});
http://jsfiddle.net/6hvZT/648/
Thanks
addClassdoesn't expect a second argument