• 页面右键下拉表


    程序代码 程序代码

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

  • 相关阅读:
    (转)学习笔记viewController(欢迎指错)
    配置Xcode版本控制SVN详细步骤内含解决Xcode/Mac OS10.8无法配置SVN的解决方法(转)
    iPhone 3G/3GS(有锁)基带与导航功能
    [转]Iphone 3G/3Gs Home键失灵的根本原因和解决方法
    NSDate的常用用法(转)
    短信操作(转)
    如何在Symbian SDK下使用GCCE4(转)
    nS60_sdk_v1_2的VC6问题(转)
    如何获取应用程序图标(转)
    如何实现圆角的UITextView iphone短信发送(非系统界面)
  • 原文地址:https://www.cnblogs.com/Bany/p/1755511.html
Copyright © 2020-2023  润新知