This js code using for making zooming on a click picture. But i don't get clicked image src. Its working fine in exemple, but unfortunately not in my site. Why may it happens?
Example with working code https://codepen.io/Evangelion_01/pen/zEoKaR
code in my site, js file:
$(document).ready(function() {
$(".pro02_01_box").click(function(){ //.pro02_01_box class of that image
let img = $(this); //get cklicker img url
let src = img.attr("src"); //wrote the value into a variable
$("body").append("<div class='popup'>"+
"<div class='popup_bg'></div>"+
"<img src='"+src+"' class='popup_img' />"+
"</div>");
$(".popup").fadeIn(200);
$(".popup_bg").click(function(){ затемненный фон
$(".popup").fadeOut(200);
setTimeout(function() {
$(".popup").remove();
}, 200);
});
});
});
Answer in browser console: