网页中实现循环播放广告时,主要可以通过JavaScript和Flash结合的方式实现,与HTML语言提供的MARQUEE元素相比,前者可以使图片循环不间断地显示,可以更加美化网页。
<body style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px;"> <script type="text/javascript"> var focus_width = 421 var focus_height = 156 var text_height = 0 var swf_height = focus_height + text_height var pics = 'images/1.jpg|images/2.jpg|images/3.jpg|images/4.jpg' var links = '||' var texts = '' var banner = '<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="images/banner.swf"><param name="quality" value="high"><param name="bgcolor" value="#DADADA">' 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(banner); 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 + '">'); document.write('</object>'); </script> </body>