Friday, 13 September 2013

Which div is currently active?

Which div is currently active?

I have a series of divs ( displaying graphics). Click one graphic div and
something is written in a div.
$("#graphic1").click(function(){
$("#text").html("Something important goes here.")
}
But if the user clicks graphic1 when graphic8 is displayed I want it to do
something else
if (graphic8 was active before graphic1 was clicked){
do this
} else {
do that
}
To explain further
there are many divs.
any one of these divs may be active at one time.
when selecting a new div I would like to know which div was active BEFORE
the new div was selected.

No comments:

Post a Comment