Answer the question
In order to leave comments, you need to log in
Why does the open window function not work correctly?
I'm practicing with jQuery and stumbled upon a problem.
I tried to make a function in which, using the "data-popup" HTML attribute, when a button is pressed, the corresponding pop-up will open. But for some reason, both windows open when you click.
Link to the code in CodePen
What is the problem and how can I find such errors myself in the future?
Answer the question
In order to leave comments, you need to log in
$popup = $('.popup__wrapper'); // запомнили все попапы
popupData = $popup.data(dataKey, dataValue); // записали им что-то в data-атрибут, хз зачем
popupData.addClass('popup__wrapper_show'); // показали запомненные попапы (все)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question