Adding a play/pause button to a pre-existing slider script.
Hello all, My name is Marcus and I am new to this so please forgive my ignorance.
I recently put up a webpage using this online demo/tutorial http://tympanus.net/Tutorials/Elasti...how/index.html
I decided to go with "Demo 2" (with autoplay). Everything worked perfectly but now I would like to add a pause/play button to the slider interface.
Looking at http://tympanus.net/Tutorials/Elasti...eislideshow.js
lines 343 to 351 includes an if statement featuring
this seems to be the key to shutting off the autoplay when the user clicks a thumbnail.
I would like someone to show me how to write a function that can be attached to a button which will pause the slide show by setting "_self.options.autoplay = false;" then turn it on again by changing the value back to true (assuming the show was already in a paused state).
If it isn't asking to much I would be grateful if you could please show me the following:
1. how the whole function should look
2. where exactly to paste the function into my page
3. an example of the button code that is required to id the button as the play pause toggle.
Thank you very much for taking the time to help me out on this. It is very much appreciated.
you need a global variable oop
Thank you very much Vic!:) It works. But, there is now another related issue.
Perhaps you could assist me further?
I posted my page here
and the js file is here http://3dmaker.com/champion/new/js/j...eislideshow.js
As you can see the pause button allows one more slide to reveal before pausing, so the show pauses, but the desired slide isn't being paused.
Best I can figure is the slideshow is really two functions first is a delay to display the slide for a specified interval, second is the animation of the slide off the stage. I guess this was done so the first slide displayed wouldn't just disappear on arrival to the page?
I noticed that when play is clicked that the delay comes first then a new slide. I think this confirms my hypothesis, but I don't know what to do about it.
Regarding the pause button, is it possible to stop any functions that have already been cued up before they trigger? And could the play function start the slideshow but skip the initial delay?
have a look at
Thanks for the link it was very interesting. But as I understand so little of the scripting I couldn't figure out how to fix my issue.
|All times are GMT +1. The time now is 03:25 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.