您的位置:首页 > 其它

关于Flash提示“单击击活并使用此控件”的解决方案

2007-04-05 11:24 501 查看
   网站上的Flash都提示“单击击活并使用此控件”,只有点击一次Flash后,才能单击该Flash。
解决方法:
1:页面结构是一个Div(div1)里面包含两个Div(div2,div3)和一个Table,
其中div2里主要是放一张空图片,指定图片的宽和高为要显示的Flash的宽和高
其中div3的内容为空(页面加载的时候动态的加载Flash)
其中table是一些附加作用,如隐藏Flash
 2:设置div1和div的样式
 3:动态加载Flash

下面是完整代码:

<SCRIPT LANGUAGE='JavaScript'>
function closeDL(dlid1,dlid2) {
document.getElementById(dlid1).style.visibility='hidden';
if (dlid2)
{
document.getElementById(dlid2).style.visibility='hidden';
}
}
function insertFlash(elm, url, w, h, id) {
if (!document.getElementById(elm)) return;
var str = '';
str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" id='+id+'></embed>';
document.getElementById(elm).innerHTML = str;
}
</script>
<div id=flashdllayer346130a0478588 style='position: absolute;visibility:visible;z-index:1;top:5px;right:2px;'>
<div style='position:absolute; z-index:2; width:100px;height:280px;top:0px;right:0px;'> <a href="http://localhost/index.htm" target="_blank"><img src="http://localhost/blank.gif" width="100" height="280" border="0"></a></div>
<div id="flashdllayer346130a0478588_swf"></div>
<table width="100" bgcolor="#CCCCCC" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="padding-top:2px;padding-right:3px;"><a href="javascript:closeDL('flashdllayer346130a0478588','flashdllayer246130a0478588');" style="font-size:12px;color:#000000;text-decoration:none;" target="_self">关闭</a></td>
</tr>
</table>
</div>
<script type="text/javascript">
insertFlash("flashdllayer246130a0478588_swf", "http://localhost/dl.swf","100", "280", "dl");
</script>
</div>

结束
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐