Onclick>Visited>Image>Replace? (3 posts)

  1. xiao_coffe
    Posted 2 years ago #

    I have searched in Google for an answer on how an image should be replaced when a user click on a image/link (and stay that way). Every user should click the link/image. So i think visited will be best!

    I've tried onclick example but it just goes back to the first picture again after refresh.

    Also tried a:visited on background-images and hide text link but image will not change.

    (I know how to get for exempal links turns green but not switch image)

    It is the only feature that I have left before my website is finished, so I must get it to work.

    is there any jquery code that can solve this, or is it possible with HTML and CSS?

  2. Timothy Jacobs
    Posted 2 years ago #

    I would recommend posting your question at Stack Overflow.

    That being said, my initial thought would be to do away with the actual <img> tags, and use background-image properties for both a and a:visited.

    If, that doesn't work, you would need to use cookies and set a cookie via jQuery when the link is clicked, and then switch out the <img> based on the value of the cookie that you set.

  3. xiao_coffe
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic