当前位置: 代码迷 >> Web前端 >> 障蔽右键+自定义
  详细解决方案

障蔽右键+自定义

热度:393   发布时间:2012-11-22 00:16:41.0
屏蔽右键+自定义
下载GoogleCode里的RightClickManager包,修改index.template.html
<script type="text/javascript">
            // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
            var swfVersionStr = "${version_major}.${version_minor}.${version_revision}";
            // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
            var xiSwfUrlStr = "${expressInstallSwf}";
            var flashvars = {};
            var params = {};
            params.quality = "high";
            params.bgcolor = "${bgcolor}";
            params.allowscriptaccess = "sameDomain";
            params.allowfullscreen = "true";
            params.wmode = "opaque";//增加即可
            var attributes = {};
            attributes.id = "${application}";
            attributes.name = "${application}";
            attributes.align = "middle";
            swfobject.embedSWF(
                "${swf}.swf", "flashContent", 
                "${width}", "${height}", 
                swfVersionStr, xiSwfUrlStr, 
                flashvars, params, attributes);
            // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
            swfobject.createCSS("#flashContent", "display:block;text-align:left;");
        </script>


在程序初始化的时候调用一下RightClickManager.regist()即可实现屏蔽,右键的菜单可以通过添加右键事件.addEventListener(RightClickManager.RIGHT_CLICK,rightClickHandle);进行实现了。
  相关解决方案