dimsemenov / Magnific-Popup

Light and responsive lightbox script with focus on performance.
http://dimsemenov.com/plugins/magnific-popup/
MIT License
11.39k stars 3.48k forks source link

AutoPlay Magnific-Popup #1109

Open psasser opened 5 years ago

psasser commented 5 years ago

Hello quick question. I found this answer online of how to autoplay the magnific-popup... https://stackoverflow.com/questions/31284506/magnific-popup-autoplay-slideshow

However I want to modify one thing. If the user has clicked on the arrow (prev or next) I want the autoplay functionality to stop. Any thoughts on how to achieve this?

psasser commented 5 years ago

I was actually able to resolve this by adding this into the open callback along with the code in the link above....

$(".mfp-arrow").click(function() { clearInterval(myVar); });

$(document).keydown(function(e){ if (e.which == 37 || e.which == 39 ){ clearInterval(myVar); } });