I cant seem to find a correct way to make a selector,
It’s supposed to fire clicks only on the background of a DIV, and on the main image – if there is one,
but if I click on some other elements located in that div – like a hrefs etc – it should do nothing.
I tried this:
$('#SHOWCASE, #SHOWCASE > img')
Showcase – is the ID of the DIV, and img is the image attached directly to it.
However if I add .Click function to it, it still triggers on whatever element is in that div, like links etc, note that these links also have absolute position.
So is there any solution for this?
In the simplest way, just test whether the clicked element is the element you bound the handler to:
Reference:
event.target