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> 

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


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

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
You need to refer to documentation, there is the event open pop-up when PC.
 // 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