页面中嵌入了Flash时滚动条问题
生活随笔
收集整理的這篇文章主要介紹了
页面中嵌入了Flash时滚动条问题
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
用于解決在頁面中嵌入了Flash時滾動條問題的處理
初始化加入以下代碼:
stage.addEventListener(MouseEvent.MOUSE_OVER,function (e:MouseEvent):void{ExternalInterface.call("eval","if(navigator.userAgent.indexOf ('Firefox')>0){var __on_flash_wheel=function(e){e.preventDefault(); e.stopPropagation();};window.addEventListener('DOMMouseScroll', __on_flash_wheel, false);}else{document.onmousewheel=function(){return false;};}");});stage.addEventListener(MouseEvent.MOUSE_OUT,function(e:MouseEvent):void {ExternalInterface.call("eval","if (navigator.userAgent.indexOf('Firefox')>0){window.removeEventListener ('DOMMouseScroll', __on_flash_wheel, false);}else {document.onmousewheel=null;}");});?
?或者扔在FLASH體外:
<script language="JavaScript" type="text/javascript">var isFF = navigator.userAgent.toLowerCase().indexOf('firefox');var mousewheel=function(event){var event = event ? event : window.event;var obj = event.srcElement;if (!obj){obj = event.target;}//此處可以加入判斷,來實現類似百度文庫的效果,先把瀏覽器滾動條移至可以完全顯示flash的位置,然后再操作flash內部滾動條
if(obj.type == "application/x-shockwave-flash" || obj.type == ""){if(isFF > 0){event.preventDefault();event.stopPropagation();}else{return false;}}}function onloaded(){if(isFF > 0)document.body.addEventListener("DOMMouseScroll", mousewheel, false);elsedocument.body.onmousewheel=mousewheel;}window.onload = function(){onloaded();}</script>
?如果是嵌入的FlexPaper,需要對FlexPaper的內部代碼進行修改,因為FlexPaper內部會在加載時往頁面上加載部分代碼,導致瀏覽器滾動條不失效,MacMouseWheelHandler類
轉載于:https://www.cnblogs.com/Carpe-Diem/archive/2011/12/28/2304505.html
總結
以上是生活随笔為你收集整理的页面中嵌入了Flash时滚动条问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 简单-三层-存储过程-增删改四
- 下一篇: SAP HANA能否推动实时应用?