Answer the question
In order to leave comments, you need to log in
How to change events after the first click?
Hello!
How to make it so that on the first click one cycle is performed, and on the subsequent ones another?
$(".products-toggle").click(function(e) {
e.preventDefault();
//первый цикл
productsRow = $(this).parent().siblings('.products-row');
if(productsRow .hasClass("shown")) {
productsRow .animate({"height": "50px"}).removeClass("shown");
} else {
productsRow .animate({"height": "auto"}).addClass("shown");
animateHeight = productsRow .height();
}
//после первого выполнять это
if(productsRow .hasClass("shown")) {
productsRow .animate({"height": "50px"}).removeClass("shown");
} else {
productsRow .animate({"height": animateHeight }).addClass("shown");
}
});
Answer the question
In order to leave comments, you need to log in
Add the data attribute to the element.
If there is nothing in it, the launch of 1 logic
If there is a launch of the 2nd
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question