Example of the problem here: http://jsfiddle.net/EtWXX/
I have my infinite carousel set to auto play. It also has videos embedded. I need it to do two things however.
- Stop if a video is played.
- Stop if 'next' & 'prev' are interacted with.
Example of the problem here: http://jsfiddle.net/EtWXX/
I have my infinite carousel set to auto play. It also has videos embedded. I need it to do two things however.
You just need to call
clearInterval(intervalId)when things are interacted with, then set it up again withintervalId = window.setInterval(slide, 5000);when you want it to start sliding again. if you wanted it to pause on hover you'd do something like:I don't know what the code would be to detect a vimeo video playing or not, but it's trivial to turn the scrolling on/off this way.
EDIT
For vimeo you should check out their API you have to add
?api=1to the end of your vimeo URL in theiframeand load their library called froogaloop that you can use to do this:that should stop the slideshow when you play the video, and restart it when the video stops, it's listening for events from the API
as for the prev & next, just add the clear interval right after
jQuery(next).click(function(event) {andjQuery(prev).click(function(event) {in the plugin's code, I don't know how you'd want to resume the slideshow though, but we already know the code for that...