From d2e0d6bdf13325c2569dd2c9031149d8904a6c0f Mon Sep 17 00:00:00 2001
From: gucheen Find more information on github.
jQuery pop menu
- click the button below to have a try.
+ click these buttons below to have a try.
-
-$('#demo_box').popmenu();
+
+
+ How to use:
+
+ $('#demo_box').popmenu();
+ jQuery pop menu
diff --git a/jquery.popmenu.min.js b/jquery.popmenu.min.js index db79e2f..7d320a5 100644 --- a/jquery.popmenu.min.js +++ b/jquery.popmenu.min.js @@ -1 +1 @@ -!function(o){o.fn.popmenu=function(r){function t(){i.css({display:e,position:"absolute","margin-top":-n.top,"margin-left":-n.left,background:n.background,width:n.width,"float":"left",padding:"0","border-radius":n.borderRadius}),s.css({display:"block",color:"#fff","float":"left",width:n.iconSize,height:n.iconSize,"text-align":"center","border-radius":n.borderRadius}),u.css({"text-decoration":"none",color:"#fff"}),a.hover(function(){a.css("cursor","pointer")},function(){a.css("cursor","default")}),a.click(function(r){r.preventDefault(),i.show("fast"),o(document).mouseup(function(o){var r=i;r.is(o.target)||0!==r.has(o.target).length||r.hide(),r.hide()})}),s.hover(function(){o(this).css({background:n.focusColor,cursor:"pointer"})},function(){o(this).css({background:n.background,cursor:"default"})})}var n=o.extend({controller:!0,width:"300px",background:"#34495e",focusColor:"#1abc9c",borderRadius:"10px",top:"50",left:"0",iconSize:"100px"},r);if(n.controller===!0)var e="none";else e="block";var c=o(this),i=c.children("ul"),s=i.children("li"),u=s.children("a"),a=o("#pop_ctrl");return t()}}(jQuery); \ No newline at end of file +!function(a){a.fn.popmenu=function(b){function j(){f.css({display:d,position:"absolute","margin-top":-c.top,"margin-left":-c.left,background:c.background,width:c.width,"float":"left",padding:"0","border-radius":c.borderRadius}),g.css({display:"block",color:"#fff","float":"left",width:c.iconSize,height:c.iconSize,"text-align":"center","border-radius":c.borderRadius}),h.css({"text-decoration":"none",color:"#fff"}),i.hover(function(){i.css("cursor","pointer")},function(){i.css("cursor","default")}),i.click(function(b){b.preventDefault(),f.show("fast"),a(document).mouseup(function(a){var b=f;b.is(a.target)||0!==b.has(a.target).length||b.hide(),b.hide()})}),g.hover(function(){a(this).css({background:c.focusColor,cursor:"pointer"})},function(){a(this).css({background:c.background,cursor:"default"})})}var c=a.extend({controller:!0,width:"300px",background:"#34495e",focusColor:"#1abc9c",borderRadius:"10px",top:"50",left:"0",iconSize:"100px"},b);if(c.controller===!0)var d="none";else d="block";var e=a(this),f=e.children("ul"),g=f.children("li"),h=g.children("a"),i=e.children(".pop_ctrl");return j()}}(jQuery); \ No newline at end of file diff --git a/src/jquery.popmenu.js b/src/jquery.popmenu.js index b80bcd3..e34a84a 100644 --- a/src/jquery.popmenu.js +++ b/src/jquery.popmenu.js @@ -28,7 +28,7 @@ Based on jQuery 2.0.3 var tar_body = tar.children('ul'); var tar_list = tar_body.children('li'); var tar_a = tar_list.children('a'); - var tar_ctrl = $('#pop_ctrl'); + var tar_ctrl = tar.children('.pop_ctrl'); function setIt() { tar_body.css({