How to control a conflicting click event with jQuery -


i have following html...

<div id="panel"> <a class="ext" href="http://google.com">google</a> </div> 

if have $(#panel).on({ click: function(e) {...} event expand div height or collapse it, how tell click event "not fire" if click on .ext class item, can go google.com.

thanks advice

an alternative approach test target of click event:

$('#panel').on({     click: function(e) {         var target = e.target,             $target = $(target);         if ($target.hasclass('ext')) {             window.location = target.href;         }         else if {             // whatever you'd click on #panel         }     }); 

references:


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -