zoukankan      html  css  js  c++  java
  • javascript flash 弹框

    1. [代码]FlashBox     
    // JavaScript Document
    function FlashBox(src,width,height){
    var docbody = document.body; 
    var _w = docbody.offsetWidth; 
    var _x = parseInt((_w-width) / 2);



    var screendiv = document.createElement("div");
    screendiv.style.cssText = '100%; height:100%; bottom:0; background:#000; filter:Alpha(opacity=80);opacity:0.8; z-index:998;position:fixed;_position:absolute;z-index:10;top:0;_top:expression(eval(document.documentElement.scrollTop));';http://www.huiyi8.com/css3/


    var panel = document.createElement("div");
    panel.style.cssText = ' position:absolute; z-index:999; left:'+ _x +'px;  '+width+'px; height:'+height+'px; position:fixed;_position:absolute;z-index:10;top:200px;_top:expression(eval(document.documentElement.scrollTop+200)+"px"); border:3px solid #000; ';

    var close = document.createElement("div");
    close.style.cssText = 'position:absolute; z-index:999; top:-24px; right:-24px; 30px; cursor:pointer; height:30px; background:url(closebox.png)';


    var iframe= document.createElement("iframe"); 
    iframe.style.cssText = 'display:block; 100%; height:100%';
    iframe.width = iframe.height = "100%"; 
    iframe.scrolling="no";css3教程
    iframe.setAttribute("frameborder","0");

    panel.appendChild(close);
    panel.appendChild(iframe);


    docbody.appendChild(screendiv);
    docbody.appendChild(panel);


    var newDoc = iframe.contentWindow.document.open("text/html","replace");
    var txt = '<html><style type="text/css">*{ margin:0; padding:0}</style><body>'+
    '<embed height="'+height+'" width="'+width+'" src="'+src+
    '" type="application/x-shockwave-flash" scale="showall" play="true" loop="true" menu="true"></embed></body></html>'; 

    newDoc.write(txt);
    newDoc.close();

    close.onclick=function(){ 
    panel.parentNode.removeChild(panel);
    screendiv.parentNode.removeChild(screendiv); 
    } 

    }
    //demo
    FlashBox('http://player.youku.com/player.php/Type/Folder/Fid/15455979/Ob/1/Pt/0/sid/XMzA1NzIwMTI4/v.swf',600,400);

  • 相关阅读:
    Spring的IOC容器学习笔记
    全球疫情可视化展示
    GitHub-暂存区与版本回退
    GitHub-创建仓库与本地同步
    Shell脚本常用模板
    Shell按行读取文件的3种方法
    shell脚本:通过域名获取证书的过期时间
    如何禁止chrome浏览器http自动转成https 【转】
    kafka_2.11-2.0.0_常用操作
    kafka_2.11-2.0.0_安装部署
  • 原文地址:https://www.cnblogs.com/xkzy/p/3824373.html
Copyright © 2011-2022 走看看