I need to trigger an event (e.g. hide a floating shopping cart) when clicking on the background of the page (#page) but this event not to occur when clicking inside content. So I need this event to occur on the space: page minus content. How do I achieve it? Thanks
If I have this structure:
<body>
<div id="page">
<div id="content">
here
</div>
</div>
</body>
var outer= jQuery("#page");
jQuery(outer).click(function(){
jQuery(cos_de_cumparare).toggle();
});
you could check the target of the event and act accordingly
fiddle here http://jsfiddle.net/wNsd7/