View Full Version : Ignore href of <a> if JS enabled?

06-09-2004, 10:19 PM
I've got an image gallery and what I would like is to have JS enabled users swap a larger image source when clicking the thumbnails, but that if JS is disabled, the href of the thumbnail link would be to the larger image.

<a href="images/big.jpg" onclick="enlarge('big.jpg')"><img ... /></a>

Thanks in advance to any helpful parties...

06-09-2004, 10:26 PM
<a href="..." onclick="return yourFunction()">
where yourFunction returns false to cancel further anchor onclick action

06-09-2004, 10:28 PM
I had a feeling it was something like that, but I am teh JS n00b. Thank you. :)