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('.off').unbind("click").click(function(event){
        alert('点击了切换用户');
      });
      $btnmenu.find('.exit').unbind("click").click(function(event){
        alert('点击了退出系统');
      });
      return false; 
  });

 

转载于:https://www.cnblogs.com/zhaogaojian/p/10534376.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值