The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How can I control one element by clicking on another?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #33625

    What I’d like to be able to do is click on an image of a light switch (on and off) which will swap out one image with another. Basically what I’ve got is a .gif of a blinking banner which I only want to use when the user activates it. When it’s inactive I have a .png file I want to use in it’s place.

    I’m sure this is possible but I’ve no idea what this is called which has made searching for demos rather tricky. And obviously I’m no ninja when it comes to jQuery because I’m sure the solution is rather easy! At least it feels like it would be to anyone who knew jQuery.

    Any help much appreciated!



    you can do this with javascript I guess, take a look at this site and read the second example which is ‘Hide and Show a Div with JavaScript’

    So if you use what they have shown you and modify it to your needs you should be fine! Let us know if you get it to work!

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.