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

Function that returns a formatted array in VBA -

Admob integration with pygame in android -

gwt - Using Gin to Inject Multiple Views -