Я работал с приведенным ниже кодом, появится всплывающее содержимое, которое я хочу
function init_magnificPopup()
{
$('.popup-with-zoom-anim').magnificPopup({
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
}
$(document).ready(function() {
init_magnificPopup();
});
HTML
<a class="btn btn-primary popup-with-zoom-anim" href="#dialog">dialog popup</a>
<div id="dialog" class="zoom-anim-dialog mfp-hide">
popup content
</div>
Теперь, как я могу работать с динамически создаваемым тегом ниже с классом .popup-with-zoom-anim
?
var content_string += '<a class="popup-with-zoom-anim" href="#dialog">dynamic dialog popup</a>';
$( "body" ).html(content_string);