• 页面右键下拉表


    <script type="text/javascript" language="javascript" >
            document.oncontextmenu=click;
            var appState = new applicationState();
            function applicationState() {
                this.contextMenu = null;
            }
            function click()
            {
                var str="";
                    str="<div style='position: absolute;background-color:#48b4fc;'><table border='1'>";
                    str+="<tr onmouseover='fn_set(this);'><td>111<td><tr>";
                    str+="<tr onmouseover='fn_set(this);'><td>222<td><tr>";
                    str+="<tr onmouseover='fn_set(this);'><td>333<td><tr>";
                    str+="<tr onmouseover='fn_set(this);'><td>444<td><tr>";
                    str+="</table></div>";
                if(appState.contextMenu != null) appState.contextMenu.removeNode(true)

                document.body.insertAdjacentHTML("beforeEnd", str)
                contextMenu = document.body.childNodes(document.body.childNodes.length-1)
                contextMenu.style.left = window.event.x
                contextMenu.style.top = window.event.y;
                appState.contextMenu = contextMenu
                window.event.cancelBubble = true;
                return false;
            }
            function fn_set(obj){
                obj.style.color="#24b400";
            }
            function clean() {
              var contextMenu
              if(appState.contextMenu != null) {
                contextMenu = appState.contextMenu.removeNode(true)
                contextMenu = null
              }
            }
            </script>
            <script event=onclick() for="document" type="text/javascript">clean();</script>//处理页面单击事件,关闭下拉表

  • 相关阅读:
    java 字符串split有很多坑,使用时请小心!!
    Java并发编程:线程池的使用
    java自带线程池和队列详细讲解
    merge into的用法
    Oracle中如何使用REGEXP_SUBSTR函数
    oracle分组统计某列逗号隔开数据
    oracle一列中的数据有多个手机号码用逗号隔开,我如何分别取出来?
    css box-shadow使用---转
    201706问题记录
    201705问题记录
  • 原文地址:https://www.cnblogs.com/freeliver54/p/631489.html
Copyright © 2020-2023  润新知