Monday, 9 September 2013

jquery click container but exempt a wrapped element

jquery click container but exempt a wrapped element

I am using jquery Isotope and have an element div that hold another div.
These are tiles - of which there are many.
<div class=element > blah blah
<div class=setStamp>load X text</div>
blah blah blah blah
</div>
<div class=element > blah blah
<div class=setStamp>load Y text</div>
blah blah blah blah
</div>
There is a click trigger on all .element that toggles class 'large' I want
to be able to click setStamp and not trigger the toggle. The best way I
have so far is double click.
$container.delegate( '.element', 'dblclick', function(){ // enlarge
clicked element
$(this).toggleClass('large');
$container.isotope('reLayout');
});
But I would like to maintain a simple single click. I am experimenting
with ! .not() and generally looking. Any suggestions?

No comments:

Post a Comment