"Dennis M. Marks" <de******@dcsi.net> writes:
I found a javascript that displays a clock that follows the mouse.
I was about to say that that was a horrible idea. I must say it looks
cool, though. Still not something I would want on a normal web page.
It is all about style, an not about telling the time, so save it for
a high-style/low-content page.
Checking the code, I can see that it will not work in Mozilla/Netscape
6+, since it uses either document.layers or document.all, neither of
which is available in Mozilla.
I would like to not have it appear on the page until a link is
clicked.
The call that starts the clock is to the function "Delay". It is
called when the page is loaded by the assignment:
if (ns||ie)window.onload=Delay;
You can call it yourself instead. Don't use a link though. Links
are for linking to other pages. If you want something to click
for an effect, use a button.
<input type="button" value="start clock" onclick="Delay()">
and remove the onload assignment.
It will disappear when another link is clicked.
This one is harder, since that functionality is not included.
What you can do is move it off the screen. Set the variable
clockFromMouseY to minus one million or so, thay should make
sure the clock is not visible.
<input type="button" value="start clock"
onclick="ClockFromMouseY=0;if (!window.started) {Delay()}
else {window.started=true};">
<input type="button" value="stop clock" onclick="ClockFromMouseY=-1E6">
You could add code to stop the timer too, if you think it is
necessary, but that requires changing the code.
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'