seanly

广告Flash在IE与filefox都显示

由于filefox不支持object,于是只能用embed代替

前台:

        <div class="HDP">
        <script type="text/javascript" language="javascript" src="Js/FLASH_HDP.js"></script>
        </div>

 

FLASH_HDP.js文件:

 

imgUrl1="Img/ImgShow/1.jpg";
imgtext1=""
imgLink1=escape("#");
imgUrl2="Img/ImgShow/2.jpg";
imgtext2=""
imgLink2=escape("#");
imgUrl3="Img/ImgShow/3.jpg";
imgtext3=""
imgLink3=escape("#");
imgUrl4="Img/ImgShow/4.jpg";
imgtext4=""
imgLink4=escape("#");
imgUrl5="Img/ImgShow/5.jpg";
imgtext5=""
imgLink5=escape("#");

 var focus_width=974   
 var focus_height=300
 var text_height=18
 var swf_height = focus_height+text_height
 
 var pics=imgUrl1+"|"+imgUrl2+"|"+imgUrl3+"|"+imgUrl4+"|"+imgUrl5
 var links=imgLink1+"|"+imgLink2+"|"+imgLink3+"|"+imgLink4+"|"+imgLink5
 var texts=imgtext1+"|"+imgtext2+"|"+imgtext3+"|"+imgtext4+"|"+imgtext5
 
 //针对IE
 document.write(\'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="\'+ focus_width +\'" height="\'+ swf_height +\'">\');
 document.write(\'<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="Img/ImgShow/focus.swf"><param name="quality" value="high"><param name="bgcolor" value="#F0F0F0">\');
 document.write(\'<param name="menu" value="false"><param name=wmode value="opaque">\');
 document.write(\'<param name="FlashVars" value="pics=\'+pics+\'&links=\'+links+\'&texts=\'+texts+\'&borderwidth=\'+focus_width+\'&borderheight=\'+focus_height+\'&textheight=\'+text_height+\'">\');

 

//针对filefox
 document.write(\'<embed src="Img/ImgShow/focus.swf" bgcolor="#F0F0F0" width="\'+ focus_width +\'" height="\'+ swf_height +\'" quality="high" wmode="opaque" FlashVars="pics=\'+pics+\'&links=\'+links+\'&texts=\'+texts+\'&borderwidth=\'+focus_width+\'&borderheight=\'+focus_height+\'&textheight=\'+text_height+\'"><embed>\')
 document.write(\'</object>\');

 

flash文件:广告FLash文件

分类:

技术点:

相关文章:

猜你喜欢
相关资源
相似解决方案