Answer the question
In order to leave comments, you need to log in
How to separate two sections of code in html so that they do not interfere with each other?
I have two product cards on my site. Each card has a picture, when you click on it, a modal window opens. But when I add two product cards, the modal doesn't open. How can two sections of code (two cards) be separated so that they do not interact together?
Answer the question
In order to leave comments, you need to log in
Bring it on
$('.card-img').click(function () {
$('.modal-bg').toggle(50);
$('.modal-bask-btn').click(function () {
$('.modal-bg').hide();
});
});
$('.card-img').click(function () {
$('.modal-bg').modal('show');
});
Make it so that when you click on card-img in functions, open parameters with this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question