jquery - If element is clicked do this funciton unless this child is clicked -



jquery - If element is clicked do this funciton unless this child is clicked -

in sharepoint, trying able click anywhere in grouping header element , have grouping expand/collapse. have gotten work partially. right can click anywhere in element except on <a> tag opens it. how set conditional run function when anywhere clicked except <a> tag?

here have:

$(document).ready(function() { var groupby = $(".ms-gb"); groupby.click(function(){ var groupbyanchor = $("a", this); groupbyanchor = groupbyanchor[0]; expandthisgroup(groupbyanchor)}); }); function expandthisgroup(anchor) { anchor.click(); }

put handler on kid element prevents event propagation:

groupby.find("a").click(function(e) { e.stoppropagation(); });

jquery sharepoint

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -