PDA

View Full Version : a href problems


Inch
03-13-2002, 09:49 AM
Is it possible when using an onClick event to prevent the page from jumping back to the top onClick?

I have a page which has 12 thumbnail images (6 at the top, 6 at the bottom), and when you click on a thumbnail, a corresponding larger image is shown in the middle of the page. I have used a:
<a href="#" onClick="bigimg();")>
tag to call the function which carries out the onClick. However, this causes the page to leap back to the top every time a thumbnail is clicked.

I have also tried:
<a href="javascript:void(0);" onClick="bigimg();">
but this just causes the big image not to load occasionally. Are there any other ways of doing this.

Thanks in advance. :)

montroze
03-13-2002, 12:36 PM
Perhaps a 'focus' command...but Im not sure if it will work with images.

scoutt
03-13-2002, 01:54 PM
what about

<a href="#" onClick="bigimg();"; return false>

Dr. Web
03-13-2002, 03:46 PM
<a href="#" onClick="bigimg(); return false;">

scoutt
03-13-2002, 03:49 PM
he he good catch there doc. missed that one.