Forum Moderators: open

Message Too Old, No Replies

javascript

rollover issue

         

fashezee

6:17 pm on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have assigned some text a behaviour that swaps an image. The text in question
has been assigned: <a href="javascript:;" etc...

The first image is ordinary gif; the image I would like to swap it with happens to be
an animated gif. The rollover will not work with <a href="javascript:;"
if the image to be swapped is an animated gif; It does work when I assign <a href="#" etc... >?

Anyone ever experienced this? I would use the <a href="#" however it reloads the page
and brings the user to the top of the page; using anchors would be my last resort.

Ryan8720

6:35 pm on Sep 1, 2003 (gmt 0)

10+ Year Member



search hotscripts.com for "rollover". One of the ones there will work.

tedster

8:57 pm on Sep 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would use the <a href="#" however it reloads the page

After your javascript function is stated, add ";return false;" Then you should not see the page reload.

fashezee

6:23 pm on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; return false;
}

However is still reloads the page; am I not including return falae correctly?

claus

6:32 pm on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i think it's in the href:

<a href="#" onmouseover="MM_swapImgRestore;return false;">

/claus