zoukankan      html  css  js  c++  java
  • Flash全屏功能详解

    通过flash 9新功能来实现全屏技术要注意以下几点:
          a、flash player版本必须是 9.0.18.60或更高版本;
          b、调用全屏功能代码需通过触发事件才可以运行的,如onPress,onRelease事件;
          c、在插入html 代码时需设置<param name="allowFullScreen" value="true" />;
          d、经多次研究发现,如 html代码设置成<param name="wmode" value="opaque" />或<param name="wmode" value="transparent" />时,则全屏功能无效!也就是说只有flash窗口模块设置为window时,全屏功能才有效.

    <div id="flashcontent"></div>
    <script language="javascript" src="js/swfobject.js"></script>
    <script language="JavaScript">
       
    var orginFlash = {init:false,isFullScreen:false,position:"",top:"",left:"","",height:""};
       
    function writeFlash(){
         
    var so = new SWFObject("fullscreen.swf""fplayer""100%""100%"8"#FFFFFF");
         so.addParam(
    "quality""high");
         so.addParam(
    "swLiveConnect""true");
         so.addParam(
    "menu""false");
         so.addParam(
    "allowScriptAccess""sameDomain");
         so.addParam(
    "allowFullScreen""true");
         so.write(
    "flashcontent"); 
       }
        
    function getScreenSize(){
          
    var w = 0;
          
    var h = 0;
          
    iftypeof( window.innerWidth ) == 'number' ) {
            w 
    = window.innerWidth;
            h 
    = window.innerHeight;
         } 
    else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
           w 
    = document.documentElement.clientWidth;
           h 
    = document.documentElement.clientHeight;
         } 
    else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
           w 
    = document.body.clientWidth;
           h 
    = document.body.clientHeight;
         }
         
    return {w,height:h};
       }
        
    function fullScreen(){
          
    if(!orginFlash.init){ 
            orginFlash.position 
    = document.getElementById("flashcontent").style.position;
            orginFlash.top 
    = document.getElementById("flashcontent").style.top;
            orginFlash.left 
    = document.getElementById("flashcontent").style.left;
            orginFlash.width 
    = document.getElementById("flashcontent").style.width;
            orginFlash.height 
    = document.getElementById("flashcontent").style.height;
         }
         orginFlash.init 
    = true;
         orginFlash.isFullScreen 
    = true;
         
    var screenSize = getScreenSize();
         
    try{
           document.getElementById(
    "flashcontent").style.position = "absolute";
           document.getElementById(
    "flashcontent").style.top = "0px";
           document.getElementById(
    "flashcontent").style.left = "0px";
           document.getElementById(
    "flashcontent").style.width = screenSize.width +"px";
           document.getElementById(
    "flashcontent").style.height = screenSize.height +"px";
           document.body.style.overflow
    ="hidden";
           window.scrollTo(
    0,0);
         }
    catch(e){
         }
       }
       
    function normal(){
         
    if(orginFlash.init){
           orginFlash.isFullScreen 
    = false;
           
    try{
             document.getElementById(
    "flashcontent").style.position = orginFlash.position;
             document.getElementById(
    "flashcontent").style.top = orginFlash.top;
             document.getElementById(
    "flashcontent").style.left = orginFlash.left;
             document.getElementById(
    "flashcontent").style.width = orginFlash.width;
             document.getElementById(
    "flashcontent").style.height = orginFlash.height;
             document.body.style.overflow
    ="auto";
           }
    catch(e){
           }
        }
       }
       
    function reSize(){
          
    if(orginFlash.isFullScreen){
             fullScreen();
          }
        }
       window.onresize 
    = reSize;
       writeFlash();
    </script>
  • 相关阅读:
    作为Bootstrap中文站维护者-我们再次翻译BootstrapVue项目
    在vs2017和vs2019下发布应用之Windows程序打包-附图标修改和默认安装路径定义全教程
    Windows应用开发中程序窗口中的各种图标尺寸规划
    SVN设置忽略文件列表以及丢失了预定增加的文件解决方法
    基于VuePress构建高基于markdown语法的网站全教程
    国家高新技术企业门户与移动全生态开发套件-Zooma!逐浪CMS v8.1.4正式发布
    Json跨域登录问题的之Access-Control-Allow-Origin 站点跨域请求的问题
    IIS设置URL重写,实现页面的跳转的重定向方法
    163邮件:554 DT:SPM 163 smtp11,D8CowABHLj7jX_BdY+q6Ag--.21946S2 1576034275,please see http://mail.163.com/help/help_spam_16.htm?ip=117.22.255.130&hostid=smtp11&time=1576034275
    读《阿里巴巴Java开发手册 1.4.0》笔记
  • 原文地址:https://www.cnblogs.com/daidu/p/1603823.html
Copyright © 2011-2022 走看看