I have dynamically created galleries on a bunch of pages on a site using the same function. The main image at the top of the page is where the issue occurs.
I have a 50% wide div with a background image... when a user clicks the image, the div grows to 100%, and after a delay, the popup plugin loads the gallery.
Everything works beautifully the first time, but if you close the popup and click it again, it ignores the setTimeout function and just opens the plugin immediately. If I view in dev tools, I can see the div growing with transition correctly.
I have dynamically created galleries on a bunch of pages on a site using the same function. The main image at the top of the page is where the issue occurs.
I have a 50% wide div with a background image... when a user clicks the image, the div grows to 100%, and after a delay, the popup plugin loads the gallery.
Everything works beautifully the first time, but if you close the popup and click it again, it ignores the setTimeout function and just opens the plugin immediately. If I view in dev tools, I can see the div growing with transition correctly.
Any ideas?
Example: http://bayaveplantco.com/outdoor-living/
Code: popup-snippet.js.zip