Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2004
    Location
    Minneapolis, MN, USA
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Ignore href of <a> if JS enabled?

    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...

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="..." onclick="return yourFunction()">
    where yourFunction returns false to cancel further anchor onclick action
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    Regular Coder
    Join Date
    May 2004
    Location
    Minneapolis, MN, USA
    Posts
    904
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I had a feeling it was something like that, but I am teh JS n00b. Thank you.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •