zoukankan      html  css  js  c++  java
  • 页面右键下拉表

    程序代码 程序代码

    <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>//处理页面单击事件,关闭下拉表

  • 相关阅读:
    从xib初始化的UIView如何继承?
    no implicit conversion of nil into String
    @synchronized(self) 加锁引起的Crash
    iOS手工Crash解析
    iOS线程While-True死循环会发生什么
    2019年新年总结
    218. The Skyline Problem-Hard
    ReplayKit 启动录制按钮 RPSystemBroadcastPickerView 的使用
    S212-搜索+字典树-212. Word Search II-(Hard)
    mybatis批量生成
  • 原文地址:https://www.cnblogs.com/Bany/p/1755511.html
Copyright © 2011-2022 走看看