DHTML Lab - dhtmlab.com - Smooth animation using DHTML | 12
Smooth animation using DHTML
This page holds links to all test I've used. They will open in a small browser window sized to give approximately the same canvas size that I used in my tests.
A small script that times how quickly the system creates 10,000
Date() objects. "Start test" starts the test, when it's finished the time elapsed is shown in the input field.
This is the first test I created, using
setTimeout() to do the delay/animation. The delay setting in this example test is set to 10ms.
This is the second test, using
setInterval() to do the same delay/animation as the first test. Again I've set the delay setting to 10ms.
This is the third test which uses
setInterval() and a form to do a quick test of how short a delay I can get. In this test the delay is set to 1ms.
This is the fourth test which uses a for()-loop to move the layer around the browser window as quickly as possible. There's no delay. Unfortunately there's no visible movement in MSIE v4 or v5.
This is the last test I created. It uses my own delay function (aptly named "myDelay()") to create a delay. In this example test, the delay is set to 10ms. This specific test proved to be very unreliable across platforms and browsers. Again, there's no visible movement in MSIE.
This test was created by Jim Ley and mailed to me during the draft period of my article. It uses Microsoft DirectAnimation as a timer to control the movement of the layer, calling
stepLayer() at specific intervals. Because it uses DirectAnimation it's (naturally) only usable in Microsoft Internet Explorer with the DirectAnimation component installed.
Next I'll give you detailed information on all systems used.
Produced by Morten Wang andAll Rights Reserved. Legal Notices.
Created: Jan 03, 2000
Revised: Jan 03, 2000