// Open directly via API
$.magnificPopup.open({
items: {
src: '<div class="white-popup">Dynamically created popup</div>', // can be a HTML string, jQuery object, or CSS selector
type: 'inline'
}
});
<div id="text-popup" class="white-popup mfp-hide">
<div>
<p class="title">Внимание!</p>...
</div>
</div>
<script>
$(document).ready(function() {
$('#text-popup').magnificPopup.open({
type: 'inline'
});
});
</script>