This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > September 2005 > rollover image acts like an anchor





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author rollover image acts like an anchor
cyninspirit

2005-09-14, 7:33 pm

In Dreamweaver MX2004, I inserted a rollover image following instructions in
"help," and the code below was generated. But when previewing it, the image
rolls over, but also a hand appears and clicking on it takes one to the top of
the page. Can you see anything wrong in the code? Thank you!

<p><a href="#" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('horn','','images/horn_r2_c2overf2.gif',1)"><img
src="images/horn_r2_c2.gif" name="horn" width="214" height="26" border="0"
id="horn" /></a></p>


rilkesf

2005-09-14, 7:33 pm

If all you want to do is keep the link from jumping back to the top, you just
have to add '; return false;' after the closing parentheses of the javascript
statement (but still inside the ending "). This tells the browser to ignore
the link (# is a link to the top of the page) as long as the javascript
executes.

If you want to get rid of the link action altogether, you just need to apply
the mouseover action to a different element--like a <span> that encloses the
image--and get rid of the link.

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews