JGUI源码:实现图标按钮及下拉菜单(16)
作者:互联网
效果如下
代码片段如下
<div class="jgui-btn" id="personalbtn" style="float:right;"> <div class="jgui-btn-info"> <img src="./images/head.jpg"></img> <span>麦田守望者</span> <i class="jgui-btn-down"></i> </div> <div class="jgui-menu" id="testmenu"> <div class="jgui-menuitem off">切换用户</div> <div class="jgui-menuitem exit">退出系统</div> </div> </div>
//用户事件 $("#personalbtn").unbind('click').click(function () { var $this=$(this); var $btnmenu=$this.find('.jgui-menu'); //显示菜单 $btnmenu.css("top",$this.position().top+$this.height()); $btnmenu.css("left",$this.position().left); $btnmenu.css("right",10); $btnmenu.css("visibility","visible"); $btnmenu.find('.closecurtab').unbind("click").click(function(event){ $this.find(".jgui-tab-close").first().trigger("click"); }); //关闭其它 $btnmenu.find('.off').unbind("click").click(function(event){ alert('点击了切换用户'); }); //关闭左边 $btnmenu.find('.exit').unbind("click").click(function(event){ alert('点击了退出系统'); }); return false; });
标签:function,unbind,btnmenu,16,下拉菜单,find,源码,click,css 来源: https://www.cnblogs.com/zhaogaojian/p/10534376.html