Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3

Thread: html onclick

  1. #1
    Member Tristessa's Avatar
    Join Date
    Nov 2004
    Location
    Kingston, Ontario
    Posts
    94
    Member #
    8215
    I have to create a onclick for an image. This part is not the problem. The part I am having toruble with is that the image has to switch back to the previous image when clicked again.

    This is the code that I have right now:

    <img src="gcc_viewanswer.gif" width="246" height="355" onclick="this.src='gcc_galvanic_cautery.gif'">

    I would prefer to create this effect in html.

    Thanks

    Tryst.

  2.  

  3. #2
    Senior Member ceetee's Avatar
    Join Date
    Jul 2003
    Posts
    117
    Member #
    2035
    This should work

    onclick="if (this.src=='full path/original.gif') this.src='other.gif';else this.src='original.gif'"

  4. #3
    Senior Member Physt's Avatar
    Join Date
    Jul 2004
    Posts
    255
    Member #
    6655
    That won't work in a non-javascript browser though.. So there is no real benefit to doing it that way..
    www.controlalternate.com - Web resources and free templates. www.chaosconcepts.net - Custom web and graphic design.
    www.blog.chaosconcepts.net - My Blog


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 09:22 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com