title: Magnific Popup object
body: <p><strong>Magnific Popup</strong></p>
  
  <p>I use Magnific Popup, a jQuery lightbox like plugin. I try to use the built in object to get an attribute.</p>
  
  <p><strong>It does not work the way I thought it would. I've read the API here:</strong></p>
  
  <p><a href="http://dimsemenov.com/plugins/magnific-popup/documentation.html#api" rel="nofollow">http://dimsemenov.com/plugins/magnific-popup/documentation.html#api</a></p>
  
  <p><strong>What I tried so far</strong></p>
  
  <p>I get the object in the console but I can't get an attribute from it. (the jquery ready looks a bit different (alias) because it's used in WordPress)</p>
  
  <pre><code>&lt;script&gt;
  jQuery(document).ready(function($) {
      $('.image-link').magnificPopup({
          type:'image',
              callbacks: {
                  open: function() {
                      var magnificPopup = $.magnificPopup.instance;
                      console.log(magnificPopup.currItem);
                      window.location.hash = $(magnificPopup.currItem).attr('data-slug');
                      }
              }
      });
  });
  &lt;/script&gt;
  &lt;a href="http://www.someimage.com/image.png" data-slug="my-slug"&gt;
  </code></pre>
  
  <p>Own thougts</p>
  
  <ul>
  <li>This is not an object like $(this) and will not work the same?</li>
  <li>I call it the wrong way?</li>
  <li>I use the wrong object for this problem?</li>
  </ul>
  
  <p><strong>Question</strong></p>
  
  <p>How is it done correctly?</p>