llizard
05-01-2004, 06:50 PM
I am a rank beginner at Javascript. I'm not sure if this is a CSS or a Javascript question but as it concerns stopping a cursor trail script, I will pose it here in this forum.
I have placed the following on a page that has one of those irritating cursor trail scripts:
<a href="#" onclick="document.onmousemove=meander; return false;" title="Start trailing"><i>Start</i> the senseless cursor trail.</a> |
<a href="#" onclick="document.onmousemove=null; return false;" title="Stop trailing!"><i>Stop</i> the senseless cursor trail.</a>
This works perfectly to start and stop the script but when the script is stopped, the cursor trail message is still showing - static but visible.
How would I go about making the message invisible when the script is stopped?
Is it by changing the visibility from visible to hidden on the style for the cursor trail? Or might I have to set the message value to show nothing and then add the value of addit when the cursor trail starts? I foolishly imagined that the following might work:
var message=""
var addit="cursor trail... "
if (document.onmousemove=meander) {
message + addit;
}
That resulted in a big mess so (still shooting in the dark) instead of the above nonfix, I tried adding the following:
if (document.onmousemove=null) {
document.getElementById.spanstyle.visibility = "hidden";
}
Naturally, that didn't work either. Help?
The page with the cursortrail script on it is here (http://ejmtph.crosswinds.net/links.html).
I have placed the following on a page that has one of those irritating cursor trail scripts:
<a href="#" onclick="document.onmousemove=meander; return false;" title="Start trailing"><i>Start</i> the senseless cursor trail.</a> |
<a href="#" onclick="document.onmousemove=null; return false;" title="Stop trailing!"><i>Stop</i> the senseless cursor trail.</a>
This works perfectly to start and stop the script but when the script is stopped, the cursor trail message is still showing - static but visible.
How would I go about making the message invisible when the script is stopped?
Is it by changing the visibility from visible to hidden on the style for the cursor trail? Or might I have to set the message value to show nothing and then add the value of addit when the cursor trail starts? I foolishly imagined that the following might work:
var message=""
var addit="cursor trail... "
if (document.onmousemove=meander) {
message + addit;
}
That resulted in a big mess so (still shooting in the dark) instead of the above nonfix, I tried adding the following:
if (document.onmousemove=null) {
document.getElementById.spanstyle.visibility = "hidden";
}
Naturally, that didn't work either. Help?
The page with the cursortrail script on it is here (http://ejmtph.crosswinds.net/links.html).