If you can write a mathematical expression for a curve, you can usualy
use JS to either display the selected path or move an object along it.
The secret is that JS can write both css and html. An example is at
http://www.cwdjr.net/dhtml/cuckoo.html . The curtain is built up of
hundreds of narrow vertical lines. The background-color of each
division is calculated as a function of x to produce the fold effect
in the curtain. It is most convenient to work using (r,g,b) for this.
For most computers a division must have some content to avoid
distortion. A single period of 1 px size and about the same color as
the background color usually works well enough. You can then use
visibility to hide each of the curtain divisions in sequence to open
the curtain. The circle is produced in much the same way, with the
vertical strips making up the circle starting and ending on the locus
of the circle. It is convenient to use polar coordinates for this.
Another example is at
http://www.cwdjr.net/geometric/curve_write.html
.. Here some typical curves from analytical geometry are drawn. The
code to do these things usually is not very long. You just use a few
loops to generate the hundreds of document.write statements to create
all of the small divisions. The code for the first cuckoo sample is
very extreme. It validates as W3C xhtml 1.1. And how can that be, if
it has no style sheet? Even the general style sheet is written using
JS and document.write. But what does the W3C css validator think? It
is satisfied. It finds no style sheet, but does not detect any illegal
use of bgcolor, text, etc. in the code. In fact this page is nearly
all JS. The one body statment is just a dummy, that does nothing
useful, to keep the W3C xhtml 1.1 validator from complaining about no
body content detected. At lower levels of html, you often can get away
with writing the body statement itself with JS. One of the free hosts
once was using detection of the body statement to indicate that the
file was an html page suitable for their pop up ads. Some hackers
found they could defeat the ads by using a document.write to write the
body statement with "bo" and "dy" being combined in the document.write
so there was no free "body" to view. Another approach that will allow
you to do some drawing is SMIL. SMIL, the last I heard, is still not
official, but it seems to be in the final stages at the W3C. The IE6
will handle part of SMIL, but their code works only on IE6 - surprise,
surprise. Real has been a strong supporter of SMIL and their Real One
player supports most of the SMIL that the W3C has considered. It is
fun to play with. Real has a huge amount of information on SMIL, but
it takes considerable time to digest.