treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Fire events by time?

  • Hi,

    I've got a simple show/hide toggle that works like a charm but what if I wanted to cycle (eg. show/hide) through say three elements.

    Fire the event at element1
    3 secs
    fire callback for element1
    fire event for element2
    3secs
    firecallback for element2
    fire event for element3
    3secs
    firecallback for element3

    and so on.

    How can this be achieved?

    Thanks
  • Hope this helps.

    http://plugins.jquery.com/project/dAnimate

    After searching for a way to delay the firing of animations in jquery, I developed this in order to allow me to achieve it, it is inspired by Karl Swedberg's post http://www.learningjquery.com/2007/01/e ... elay-trick It allows you to specify all the normal animation parameters and then an extra parameter with the delay in it.