Results 1 to 3 of 3

Thread: Click then get a new picture

  1. #1
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Click then get a new picture

    Hey everyone i want to get some html code so that when i click a picture it changes into another picture and when you click it again it returns to the first picture and the loop starts over again..

    Like this..

    This is the picture you start with..
    http://tbn3.google.com/images?q=tbn:...s/Pokeball.gif

    Then when you click the first picture it changes into this..
    http://tbn0.google.com/images?q=tbn:...on/drowzee.gif

    then i want to get it so you can click it again and it changes back into the first picture and you can repeat the whole process again if you wanted it to




    please help?

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    You can do this with javascript. This way is messy, but it's inline so that you don't have too much trouble if you don't know what javascript is.

    Code:
    <img src="http://tbn3.google.com/images?q=tbn:flrjig-qfoXt_M:http://www.blackstardojo.org/shop/images/Pokeball.gif" onclick="if(this.src=='http://tbn3.google.com/images?q=tbn:flrjig-qfoXt_M:http://www.blackstardojo.org/shop/images/Pokeball.gif') { this.src = 'http://tbn0.google.com/images?q=tbn:jQFsbERt4slGyM:http://homepage3.nifty.com/kuma~s-world/pokemonicon/drowzee.gif'; } else { this.src = 'http://tbn3.google.com/images?q=tbn:flrjig-qfoXt_M:http://www.blackstardojo.org/shop/images/Pokeball.gif'; }">

  3. The Following User Says Thank You to magicyte For This Useful Post:

    Jack12 (03-14-2009)

  4. #3
    Join Date
    Mar 2009
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thankyou this is exactly what i wanted.

Bookmarks

Posting Permissions

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