Forum Moderators: open
My question is I got a file that looks like this:
"if (document.images) {
image1on = new Image();
image1on.src = "graphics/contents/01hi.gif";
image2on = new Image();
image2on.src = "graphics/contents/02hi.gif";, etc.."
and a changeImages() function.
I'm not sure which software autogenerated this, but my question is which is the best code to use and if it is possible to convert from one rollover code to another automatically...
The above code I found in this file of mine there are so many rollovers, the javascript takes up like 25% of the top of the file! This can't be good for search engines can it?
Either way, rollover code for different images will be huge...
You can always use external JS/CSS if you're worried abotu Search Engines.
If possible, just use two images - no text - and change the background and text color using CSS.
That's like ... 4 lines of code ;)
a:link {
background: url(img/button_normal.gif);
color: #00f;
}
a:hover {
background: url(img/button_hover.gif);
color: #f00;
}