bccu

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


    网站上的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> 

结束

发表于 2007-04-05 11:24  狂风  阅读(588)  评论(2编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-12-19
  • 2021-11-28
  • 2021-07-03
  • 2022-02-09
  • 2021-08-31
  • 2021-11-12
猜你喜欢
  • 2021-11-28
  • 2022-01-23
  • 2022-12-23
  • 2021-09-17
  • 2021-11-04
  • 2021-12-08
  • 2021-11-28
相关资源
相似解决方案