您的位置:首页 > 编程语言

网页两侧flash广告代码

2007-05-09 15:23 633 查看
<!--网页两侧flash广告代码-->
<div id="couplet_left" style="position: absolute;visibility:hidden;z-index:1">
<embed src='FLASH的URL' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="80" height="240" wmode="opaque"></embed><table cellspacing="0" cellpadding="0" width="80"
style='font-size:10px;color:#000000'><tr style="background-color:White;"><td style="width:0px;"></td><td style="CURSOR:hand; width:30px;" onclick="closeflash()">关闭</td>
</tr></table>
</div>
<div id="couplet_right" style="position: absolute;visibility:hidden;z-index:1">
<embed src='FLASH的URL' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" width="80" height="240" wmode="opaque"></embed><table cellspacing="0" cellpadding="0" width="80"
style='font-size:10px;color:#000000'><tr style="background-color:White;"><td style="width:50px;"></td><td style="CURSOR:hand; width:20px;" onclick="closeflash()">关闭</td>
</tr></table></div>

<script type="text/javascript">
couplet_left.style.visibility='hidden';
couplet_right.style.visibility='hidden';
</script>

<script type="text/javascript">
var MSIE=navigator.userAgent.indexOf("MSIE");
var OPER=navigator.userAgent.indexOf("Opera");

function doCouplet(){
if((document.body.offsetWidth>800) && MSIE!=-1 && OPER==-1){
couplet_left.style.visibility='visible';
couplet_right.style.visibility='visible';
couplet_left.style.top=100;
couplet_left.style.left=5;
couplet_right.style.top=100;
couplet_right.style.right=5;
}
}

function closeflash()
{
couplet_left.style.visibility='hidden';
couplet_right.style.visibility='hidden';
}

try{
aryADSeq.push("doCouplet()");
}catch(e){
doCouplet();
}

lastScrollX=0;
function heartBeat0()
{
diffY=document.documentElement.scrollTop;
percent=.1*(diffY-lastScrollX);
if(percent>0)
percent=Math.ceil(percent);
else
percent=Math.floor(percent);
document.all.couplet_left.style.pixelTop+=percent;
lastScrollX=lastScrollX+percent;
}

window.setInterval("heartBeat0()",1);

lastScrollY=0;
function heartBeat1()
{
diffY=document.documentElement.scrollTop;
percent=.1*(diffY-lastScrollY);
if(percent>0)
percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.all.couplet_right.style.pixelTop+=percent;
lastScrollY=lastScrollY+percent;
}
window.setInterval("heartBeat1()",1);
</script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: