JQuery Selector - Select this, not that?

Posted by JasonS on Stack Overflow See other posts from Stack Overflow or by JasonS
Published on 2010-05-11T08:38:01Z Indexed on 2010/05/11 8:44 UTC
Read the original article Hit count: 240

Filed under:
|

Hi,

I have created a script which is surprisingly working. (I do not do much JavaScript)

What I have is a load of images listed within a div. These images are hidden. JQuery gets the properties of the images and puts them into an array. When the body is clicked, the background image of the page changes. This works nicely.

However, I now have a problem. There are several elements which I shouldn't change the background when they are clicked.

Namely, navigation, footer and caption. How do I create a selector which makes the body clickable, yet ignores clicks on the above 3 div's?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-selectors