PDA

View Full Version : JavaScript Mouseover


DIGITALgimpus
01-02-2003, 04:51 PM
For compatibility and simplicity reasons (wanting to easily be able to modify the script without reuploading everything, among others) I created a mouseover.js file to hold all mouseover Javascript information:

http://media.accettura.com/html/mouseover.js

An example page is:

http://media.accettura.com/home.shtml

(that top bar is what the mouseover works with)


It doesn't seem to be working.

Does anyone see what is wrong?

I'm also aware that the javascript itself is unusually long, but it seems to be the most compatible one I have ever found. If anyone knows a simpler one that is very compatible, lay it on me ;)


Thanks

piz
01-02-2003, 05:07 PM
You have to link the js-file to your html site. You can't access to function you haven't defined in the html-file or in a linked js-file.

I can't see any <script src="html/mouseover.js"></script> in your html-file.

Saludo
piz

DIGITALgimpus
01-02-2003, 05:32 PM
It's there, right before the table for the top bar.

piz
01-02-2003, 05:46 PM
God, whats that for a mouseover script?
Is it able to make wonders or sonething incredible?

It's strange - sometimes the error apperars, sometimes not.
If you open it local it dosn't appear but there is no mouseover effect neither.

And - very sorry - i'm too lazy to read all this script...

But anyway, it shouldn't be the cause of the error, but JavaScripts you should write in the head of the page and not in the body.

DIGITALgimpus
01-02-2003, 06:19 PM
Found a new mouseover script (much leaner), and seems to be pretty compatible....

implementing now... will post how it goes.

DIGITALgimpus
01-02-2003, 06:42 PM
ok...

I got a much smaller javascript...

[fixed]

Any ideas?
-- nevermind
;)

DIGITALgimpus
01-04-2003, 12:00 AM
Ok, I got a good mouseover script...

but how can I make it so that it gets past the validator?

http://validator.w3.org/check?uri=http%3A%2F%2Fmedia.accettura.com%2Fhome.shtml

the name tag trigers it...

is there a work around?

whammy
01-04-2003, 03:34 PM
img id="img1"

DIGITALgimpus
01-04-2003, 04:05 PM
Thanks.


Seems to break the javascript in IE 6


function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
}
}
}


Works real good in Mozilla though.

Something about the line:
document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src"); Internet Exploder seems to dislike.

Can't figure out what.

DIGITALgimpus
01-05-2003, 03:02 AM
Netscape 4 also seems to dislike it.

Anyone know how to make it W3C standards savvy, and still work in all browsers?

I'm trying hard to become totally standards compliant.

DIGITALgimpus
01-05-2003, 03:35 PM
<BUMP>