我的网站是php编写的,先要在首页出现一个漂浮的广告,该如何添加代码。

如题所述

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>右侧浮动窗口代码演示</title>
</head>
<body>
<table height=1000><tr><td>演示效果看右侧,右侧调用页面为right.htm</td></tr></table>
<!-- 浮动广告代码开始 -->
<div id="ShowAD" style="position:absolute; z-index: 100;">
<div style="width:155;height:18px;font-size:14px;font-weight:bold;text-align:left;CURSOR: hand;" onClick="closead();"><font

color=ff0000>关闭</font></div>
<IFRAME allowTransparency="true" marginwidth=0 marginheight=0 src="right.htm" frameborder=0 width=155 scrolling=no
height=530></IFRAME>
</div>
<script>
var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;
var adst = document.getElementById("ShowAD").style;
adst.top = ( bodyfrm.clientHeight -530-22 ) + "px";
adst.left = ( bodyfrm.clientWidth -155 ) + "px";
function moveR() {
adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - 530-22) + "px";
adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 155 ) + "px";
}
setInterval("moveR();", 80);
function closead()
{
adst.display='none';
}
</script>

<!-- 浮动广告代码结束 -->
</body>
</html>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2012-01-19
javascript or ajax and jquery

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网