title: Magnific popup: Get current element in callback
body: <p>In Magnific Popup, I want to get an attribute in the link that is clicked and use it in a callback function (using callbacks: open) to make some changes in the DOM.</p>
  
  <p>How can I do this? For example, in the code below, it should return 'it works' to console. Instead it prints 'doesnt work'. Please help!!</p>
  
  <pre><code>&lt;a href="#test-popup" class="open-popup-link" myatt="hello"&gt;Show inline popup&lt;/a&gt;
  
  &lt;script src="jquery.magnetic.custom.js"&gt;&lt;/script&gt;
  
  &lt;script&gt;
  
      $(document).ready(function() {
        $('.open-popup-link').magnificPopup({
          type:'inline',
          midClick: true,
          callbacks: {
            open: function() {
  
              if ($(this).attr('myatt')=="hello") 
              { 
                // do something 
                console.log("it works");
              }
              else
              {
                console.log("doesnt work");
              }
  
            },
            close: function() {
  
            }
          }
  
        });
      });
  
  &lt;/script&gt;
  
  &lt;div id="test-popup" class="white-popup mfp-hide"&gt;
    Popup content
  &lt;/div&gt;
  </code></pre>