I’m using this jQuery plugin here: http://css-tricks.com/examples/MovingBoxes/
Has anyone used it or can you take a look at the jQuery code, how can i set the function to run periodically rather than on click events?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
use the setTimeout function that’s part of Javascript (http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/)
You can use setInterval instead, but for most animations setTimeout is easier to control (and more importantly… stop).
Alternatively, the jquery timer plugin http://plugins.jquery.com/project/timers can help, perhaps.
** Edit: Sorry, your question’s tone made me think you were asking about how to do timers, I didn’t realize exactly what you were looking for.
If you search for the event handlers, you’ll see that he sets the buttons get setup to call the goForward and goBackward functions as follows
Those functions start the right and left scrolling by calling the method change which scrolls the location to the specified panel #. You can do the same thing in your timer callback.