zoukankan      html  css  js  c++  java
  • js 创建一个浮动div

    //关闭DIV MENU
            function MenuClose()
            {
                var MenuDiv = document.getElementById("MenuDiv");
                if(MenuDiv != null)
                {
                    document.body.removeChild(MenuDiv);
                }
            }
            //创建menu
             function MenuPanel(opflag,operid, left, top)
             {
                var MenuDiv = document.getElementById("MenuDiv");
                if(MenuDiv != null)
                {
                    document.body.removeChild(MenuDiv);
                }
               
                var useflag = "停用帐号";
                var flag=opflag;
                if (flag == "0")
                {
                    useflag = "停用帐号";
                }
                else
                {
                    useflag = "激活帐号";
                }
                MenuDiv = document.createElement("div");
                MenuDiv.id = "MenuDiv";
                MenuDiv.onmouseleave = function()
                {
                    MenuClose();
                }
                MenuDiv.style.position = "absolute";  
                MenuDiv.style.setAttribute("zIndex" ,"201");
                MenuDiv.style.setAttribute("backgroundColor" ,"#EFEFEF");
                MenuDiv.style.setAttribute("Font" ,"10pt");
                MenuDiv.style.setAttribute("width" ,60);
                MenuDiv.style.setAttribute("left" ,left);
                MenuDiv.style.setAttribute("top" ,top);
                MenuDiv.innerHTML = "<table width=\"100%\">"
                                    +"<tr><td onclick=\"javascript:RedirectUrl(1,'" + flag + "','" + operid + "');MenuClose();\" style=\"cursor:hand;height:20px;Color:blue;\"  onmouseover=\"this.style.backgroundColor='#FFD76B';\" onmouseout=\"this.style.backgroundColor='#EFEFEF';\" align=\"left\" valign=\"top\">"+useflag+"</td></tr>"
                                    +"<tr><td onclick=\"RedirectUrl(0,0,'" + operid + "')\" style=\"cursor:hand;height:20px;Color:blue;\" onmouseover=\"this.style.backgroundColor='#FFD76B';\" onmouseout=\"this.style.backgroundColor='#EFEFEF';\" align=\"left\" valign=\"top\">修改帐号</td></tr>"
                                    +"<tr><td onclick=\"javascript:RedirectUrl(4,0,'" + operid + "')\" style=\"cursor:hand;height:20px;Color:blue;\" onmouseover=\"this.style.backgroundColor='#FFD76B';\" onmouseout=\"this.style.backgroundColor='#EFEFEF';\" align=\"left\" valign=\"top\">重设密码</td></tr>"
                                    +"<tr><td onclick=\"RedirectUrl(2,0,'" + operid + "')\" style=\"cursor:hand;height:20px;Color:blue;\" onmouseover=\"this.style.backgroundColor='#FFD76B';\" onmouseout=\"this.style.backgroundColor='#EFEFEF';\" align=\"left\" valign=\"top\">角色管理</td></tr>"
                                    +"<tr><td onclick=\"javascript:RedirectUrl(3,0,'" + operid + "')\" style=\"cursor:hand;height:20px;Color:blue;\" onmouseover=\"this.style.backgroundColor='#FFD76B';\" onmouseout=\"this.style.backgroundColor='#EFEFEF';\" align=\"left\" valign=\"top\">删除帐号</td></tr>"
                                    +"</table>";
                 document.body.appendChild(MenuDiv);
             }
             //获取控件的高度和宽度
             function getAbsolutePos(e)
             {
                var t=e.offsetTop;  
                var l=e.offsetLeft;  
                while(e=e.offsetParent)
                {  
                    t+=e.offsetTop;  
                    l+=e.offsetLeft;  
                }
               
                var pos = { x: l, y: t };
                return pos;
             }  
  • 相关阅读:
    json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
    Vue笔记(一)
    博客园设置Markdown编辑器并生成目录
    Django常用配置
    Django: django.core.exceptions.ImproperlyConfigured: Could not resolve URL for hyperlinked relationship using view name "game-detail".
    Django: AssertionError: `HyperlinkedIdentityField` requires the request in the serializer context. Add `context={'request': request}` when instantiating the serializer.
    Django CSRF cookie not set.
    HDU6962 I Love Tree(2021HDU多校第二场1002)(线段树区间加幂和模型+树链剖分)
    HDU6964 I Love Counting(2021HDU多校第二场1004)(平衡树/树状数组+二维数点+字典树)
    P4145 上帝造题的七分钟 2 / 花神游历各国(线段树)
  • 原文地址:https://www.cnblogs.com/xiarifeixue/p/1632125.html
Copyright © 2011-2022 走看看