I'm like a dog with a bone, there's got to be something wrong with what I'm doing. The following code works in IE but not FF. It's a "simple" mouse rollover --change a picture--problem:
I detect the event and call for the function, passing the relevant param.s
function rollimg(num, img_id)
{
var num=parseInt(num);
var orig_img=document.getElementById(img_id);
var orig_src=orig_img.src;
var roll_img =new Image();
roll_img.src=img_ary[num].src;
orig_img.onmouseover=function ()
{
orig_img.src=roll_img.src;
}
orig_img.onmouseout=function()
{
orig_img.src=orig_src;
}
}
I know that FF and IE detect events differently but I've not been able to tract down the relevant discussion about this issue.
Thanks for your responses, coothead and vwphillips; I'll drop your code in and see if it will work on my page; coothead, I did look at CSS sprites and got them working as a back up if this js continues to aggravate me. Thanks again both of you.
Bookmarks