i’m trying to plugin custom action to fancy close button, but nothing is happening, why is that ??
my code
$(".fancybox-close").click(function(){
$("#main-menu-nav a").removeClass("active");
$("footer").toggleClass("down", 400);
});
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Fancybox v1provides API with aonClosedmethod that’s called when Fancybox closes.Fancybox v2provides API with aafterClosemethod that’s called when Fancybox closes.The Tips & Tricks page has the method to use this public callback as seen below:
Using this method to call your custom actions will ensure they are invoked when the overlay is clicked to close Fancybox, since the button itself isn’t clicked.
Status Update: Per Simon’s Answer on this page, note his point that you may have an issue with the
switch parameterfor the.toggleClass();method since the value of400may not do what your expecting unless (as the comment states), your using jQuery UI.