Why the script doesn't work when you open a magnificPopup?

There is a popup window magnificPopup with bootstrap tabs
<div id="test-modal" class="white-popup-block mfp-hide">
<div class="tabs"> 
 <ul class="nav nav-tabs">
 the <li><a href="#tab-description" data-toggle="tab">1111111</a></li>
 the <li><a href="#tab-description2" data-toggle="tab">22222222</a></li> 
</ul>

 <div class="tab-content">
 <div class="tab-pane" id="tab-description">ddddddddddddddd</div>
 <div class="tab-pane" id="tab-description2">ggggggggggggggggggg</div>
</div>

</div>
</div>


The first tab you need to assign a class asset
the <script> 
$(".nav-tabs li:first").addClass("active");
$(".tab-pane:first").addClass("active");
</script>


But in popup window with this JS does not work, to prescribe the asset class to li not an option, as there will be a cycle, this is an example!
July 9th 19 at 13:17
1 answer
July 9th 19 at 13:19
Solution
You need to refer to documentation, there is the event open pop-up when PC.
$('.image-link').magnificPopup({
 // you may add other options here, e.g.:
 preloader: true,

 callbacks: {
 open: function() {
 // Will fire when this exact popup is opened
 // this - is Magnific Popup object
},
 close: function() {
 // Will fire when popup is closed
}
 // e.t.c.
}
});

Find more questions by tags JavaScript