我的网站是php编写的,先要在首页出现一个漂浮的广告,该如何添加代码。
2个回答
展开全部
<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>
<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>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询