把以下文件复制到记事本中,存为guanggao.js
[code]function initEcAd() { document.all.AdLayer1.style.posTop = -200; document.all.AdLayer1.style.visibility = \'visible\' document.all.AdLayer2.style.posTop = -200; document.all.AdLayer2.style.visibility = \'visible\' MoveLeftLayer(\'AdLayer1\'); MoveRightLayer(\'AdLayer2\'); } function MoveLeftLayer(layerName) { var x = 5; var y = 340; var diff = (document.body.scrollTop + y - document.all.AdLayer1.style.posTop)*.40; var y = document.body.scrollTop + y - diff; eval(\"document.all.\" + layerName + \".style.posTop = y\"); eval(\"document.all.\" + layerName + \".style.posLeft = x\"); setTimeout(\"MoveLeftLayer(\'AdLayer1\');\", 20); } function MoveRightLayer(layerName) { var x = 5; var y = 340; var diff = (document.body.scrollTop + y - document.all.AdLayer2.style.posTop)*.40; var y = document.body.scrollTop + y - diff; eval(\"document.all.\" + layerName + \".style.posTop = y\"); eval(\"document.all.\" + layerName + \".style.posRight = x\"); setTimeout(\"MoveRightLayer(\'AdLayer2\');\", 20); } document.write(\"<div id=AdLayer1 style=\'position: absolute;visibility:hidden;z-index:1\'><EMBED src=\'广告a.swf\' quality=high WIDTH=100 HEIGHT=100 TYPE=\'application/x-shockwave-flash\' id=EccoolAd></EMBED></div>\" +\"<div id=AdLayer2 style=\'position: absolute;visibility:hidden;z-index:1\'><EMBED src=\'广告b.swf\' quality=high WIDTH=100 HEIGHT=100 TYPE=\'application/x-shockwave-flash\' id=EccoolAd></EMBED></div>\"); initEcAd()[/code]
然后通过这样来调取:
[code]<html> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\"> <title>FLASH对联广告</title> <style type=\"text/css\"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; } --> </style> <!--对联FLASH广告条--> <SCRIPT FOR=\'EccoolAd\' EVENT=\'fscommand()\' LANGUAGE=\'JavaScript\'> AdLayer1.style.visibility=\'hidden\'; AdLayer2.style.visibility=\'hidden\'; </script> <script src=guanggao.js></script> </head> <body> </body> </html>[/code] (中华企业文化网)
|