2 Replies Latest reply on Apr 3, 2007 7:25 AM by NickTheNameless

    swap image from down state

    NickTheNameless Level 1
      How do I return the down state of an image to the up state onClick? I tried Swap Image Restore, that doesn't work. I want a button that contains two states, an up and a down state. When you click on the image in the up state, it goes to the down state. When you click on the image in the down state, it goes to the up state. Any help ideas, help, advice, or simple hellos would be greatly appreciated. Thanks!
        • 1. Re: swap image from down state
          info@white-hot.co.uk
          I need help with this too! I have exactly the same problem and have also tried "Swap image restore" (which should be the common sense answer) but cannot get it to work.

          Any help would be greatly appreciated.

          Rob
          • 2. swap image from down state
            NickTheNameless Level 1
            Rob,

            I've done some research on this and from what I have gathered, it isn't possible to do in the method we've been trying to do. I have found a way to accomplish my goal though. I haven't written the script yet, but it's a pretty simple idea, definitely beginner level javascript.

            For the onClick in the img tag, you have it refer to a js function that adds 1 the value of a variable. So if you click the button once the value of your variable would change from 0 to 1. When this button is clicked again, the value would change to 2. But you then include a line that say something to the effect of if x > 1, x = 0. Basically on each click of the button, the value would change to either 0 or 1. Now judging off that value is where you define the source for the image.

            Like I said, I haven't written the script yet, I have more important things to tend to on the project I'm working on right now, but when I do write it, I'll try to remember to post it here.