This is the script on my page:
Code:
<script language="JavaScript" type="text/Jscript">
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("LI");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function()
{
this.className+=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
} } }
if (window.attachEvent) window.attachEvent("onload", sfHover);
function newImage(arg) {
if (document.images) {
rslt = new Image();
rslt.src = arg;
return rslt;
}
}
function changeImages() {
if (document.images) {
for (var i=0; i<changeImages.arguments.length; i+=2) {
document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
}
}
}
var preloadFlag = false;
function preloadImages() {
if (document.images) {
buttonoff_01_over = newImage("images/buttonoff_01-over.gif");
navbutton_01_over = newImage("images/navbutton_01-over.gif");
preloadFlag = true;
}
}
</script>
The fsEls[i].onmouse out.
I wan to add to that
Code:
changeImages('navbutton_01', 'images/navbutton_01.gif'); return true;
to change the image of a button back, but i don't know what to do (the above code is used thusly in the html
Code:
<a href="#"
onclick="changeImages('navbutton_01', 'images/navbutton_01.gif'); return true;"> Mmm bacon</a>
for example)