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 = ‘width: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:‘+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; width:30px; cursor:pointer; height:30px; background:url(closebox.png)‘;
var iframe= document.createElement("iframe");
iframe.style.cssText = ‘display:block; width: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);
相关文章
- 09-13app里监控异常弹框
- 09-13win8.1弹框
- 09-13element-- 修改MessageBox 弹框 中确定和取消按钮顺序
- 09-13vue定时器+弹框 跳到登陆页面
- 09-13简单封装一个下弹框
- 09-13Openlayers 定位,添加自定义图标,点击图标弹框
- 09-13jeecg字典表—报表配置(popup弹框)
- 09-13vue 手机物理返回键关闭弹框
- 09-13弹框模块(Bootstrap Modal)
- 09-13iOS 解决WKWebView加载H5不显示弹框