Skip to content

Instantly share code, notes, and snippets.

@sunmughan
Created August 28, 2017 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunmughan/c638a75723b81caf29ca4b5773e4e9b0 to your computer and use it in GitHub Desktop.
Save sunmughan/c638a75723b81caf29ca4b5773e4e9b0 to your computer and use it in GitHub Desktop.
CHB Horizontal Menu
var cbpHorizontalMenu=(function(){var b=$("#cbp-hrmenu > ul > li"),g=b.children("a"),c=$("body"),d=-1;function f(){g.on("click",a);b.on("click",function(h){h.stopPropagation()})}function a(j){if(d!==-1){b.eq(d).removeClass("cbp-hropen")}var i=$(j.currentTarget).parent("li"),h=i.index();if(d===h){i.removeClass("cbp-hropen");d=-1}else{i.addClass("cbp-hropen");d=h;c.off("click").on("click",e)}return false}function e(h){b.eq(d).removeClass("cbp-hropen");d=-1}return{init:f}})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment