Answer the question
In order to leave comments, you need to log in
Why does the Maximum call stack size exceeded error occur?
temporarily lies on the page
since the button appears on a hover event, we won’t see it on mobile,
so I decided that when clicking on squares__item , the click was transferred to the button
$('.squares__item').on('click', function() {
$(this).find('.squares__des__button').click();
})
Answer the question
In order to leave comments, you need to log in
Read about event bubbling .
$('.squares__item').on('click', function() {
$(this).find('.squares__des__button').click();
//Событие всплывает и происходит новый клик по .squares__item
//А на нем висит вызов клика по .squares__des__button
//И так бесконечно
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question