There's lots of stuff to get your started. Lots of examples too. But thanks to minification, reading existing javascript source is getting a little more difficult. Worse for the novice however is the "magic" that libraries use. They're not very understandable to the mere mortal. I've been reading through spin.js which is less than 300 lines, and that includes three different ways of doing a spinner: css animations, setTimeout() opacity cycling, and VML for IE. But its full of css magic, and very short functions names.
I was trying to decompose it, and I remembered that there is another function similar to setTimeout(). setTimeout() calls the function once, and then spin.js anim() function calls again each time it completes its work. The other variant calls a function repeatedly at a prescribed interval.
At first I couldn't remember the second function, so I went looking on the web. I was certain that some reference for setTimeout() would mention the other version. If there is a page that connects them though, I sure couldn't find it. Thankfully, I not only remembered that there is this other version, but I finally remembered that I had used it in one of my projects to poll the address bar, when onhashchange is not defined. The function is setInterval(). When I went back to w3 schools, it was declared in the general list of window methods, but not associated in any way with setTimeout() or anything Timer based.
Blah.
Labels: dom, javascript, setInterval
Feb '04
Oops I dropped by satellite.
New Jets create excitement in the air.
The audience is not listening.
Mar '04
Neat chemicals you don't want to mess with.
The Lack of Practise Effect
Apr '04
Scramjets take to the air
Doing dangerous things in the fire.
The Real Way to get a job
May '04
Checking out cool tools (with the kids)
A master geek (Ink Tank flashback)
How to play with your kids