Im trying to get info from the element that triggered the popup, but it doesn't work.
This is the code im using: http://codepen.io/seraphzz/pen/AHIbl
$(this) isnt defined. Is it possible to access the element within one of the callback functions?
this in callbacks is Magnific Popup object, not a target jQuery element. If you want to get the element that was clicked:
beforeOpen: function() {
console.log(this.st.el);
}
Thanks for the fast reply! Worked like a charm.
Most helpful comment
thisin callbacks is Magnific Popup object, not a target jQuery element. If you want to get the element that was clicked: