I'm using Adobe Fireworks to design an interactive page. There is a picture of a human body covered in clickable slices. I made them change to green when clicked, but I ran into a problem: Is there a way in Fireworks to make the rectangle to go back to the original state when it is clicked again?

If not, can anybody give some advice for how to accomplish this in JavaScript or HTML?

Thanks!

1 answer

danwellman 5600
0
points

You could do this easily using jQuery's toggle() method which allows you to alternately execute one of n functions on click, for example:

$("#element_id").toggle(function() {
    //make element go green
}, function() {
    //make element go black
});

I don't know what code you'll be using for the clickable 'slices' hence I don't know what code you'll need inside these functions (I imagine something simple to add a class name to the clicked element perhaps)

See the jquery docs for full info on this method

Answered over 6 years ago by danwellman
  • I didn't forget about you...I'm tied up in a bunch of other stuff right now. I'll try this in a few days and get back to you ASAP mikerowe over 6 years ago