您的位置 首页 网站建设

网页中常用的对联广告代码

1.带关闭对联广告(固定位置:双关闭)

<html>
<head>
<title>带关闭对联广告(固定位置:双关闭)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
*{ margin:0; padding:0;}
body{ text-align:center; font-size:12px;}
-->
</style>
</head>
<body>
<div style="margin:auto; padding:20px 0; width:770px; height:1500px; background:#eee; position:relative;       ">
带关闭对联广告(固定位置:双关闭)
</div>
<!-- 对联 start -->
<div id="dl_left" style="position: absolute; left: 5px;       top: 65px;">
<embed src="http://blog.gulu77.com/demo/flash/dl.swf" width="100" height="300" style="display:block; font-size:1px;" wmode="transparent"></embed>
<div style="cursor: hand; background:#eeeeee; font-size:12px; text-align:left;" onClick="document.getElementById('dl_left').style.visibility='hidden';document.getElementById('dl_right').style.visibility='hidden'">关 闭</div>
</div>
<div id="dl_right" style="position: absolute; right: 5px;       top: 65px;">
<embed src="http://blog.gulu77.com/demo/flash/dl.swf" width="100" height="300" style="display:block; font-size:1px;" wmode="transparent"></embed>
<div style="cursor: hand; background:#eeeeee; font-size:12px; text-align:left;" onClick="document.getElementById('dl_left').style.visibility='hidden';document.getElementById('dl_right').style.visibility='hidden'">关 闭</div>
</div>
<!-- 对联 end -->
</body>
</html>

 

2.带关闭对联广告(固定位置:单关闭)

<html>
<head>
<title>带关闭对联广告(固定位置:单关闭)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
*{ margin:0; padding:0;}
body{ text-align:center; font-size:12px;}
-->
</style>
</head>
<body>
<div style="margin:auto; padding:20px 0; width:770px; height:1500px; background:#eee; position:relative;     ">
带关闭对联广告(固定位置:单关闭)
</div>
<!-- 对联 start -->
<div id="dl_left" style="position: absolute; left: 5px;     top: 65px;">
<embed src="http://blog.gulu77.com/demo/flash/dl.swf" width="100" height="300" style="display:block; font-size:1px;" wmode="transparent"></embed>
<div style="cursor: hand; background:#eeeeee; font-size:12px; text-align:left;" onClick="document.getElementById('dl_left').style.visibility='hidden';">关 闭</div>
</div>
<div id="dl_right" style="position: absolute; right: 5px;     top: 65px;">
<embed src="http://blog.gulu77.com/demo/flash/dl.swf" width="100" height="300" style="display:block; font-size:1px;" wmode="transparent"></embed>
<div style="cursor: hand; background:#eeeeee; font-size:12px; text-align:left;" onClick="document.getElementById('dl_right').style.visibility='hidden';">关 闭</div>
</div>
<!-- 对联 end -->
<script src="http://blog.gulu77.com/demo/style/js/copyrightdemo.js" type="text/javascript"></script>
</body>
</html>

 

3.带关闭对联广告(随屏幕滚动:双关闭)

<html>
<head>
<title>带关闭对联广告(随屏幕滚动:双关闭)</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
*{ margin:0; padding:0;}
body{ text-align:center; font-size:12px;}
-->
</style>
</head>
<body>
<div style="margin:auto; padding:20px 0; width:770px; height:1500px; background:#eee; position:relative; line-height:200%;">
带关闭对联广告(随屏幕滚动:双关闭)<br/>
</div>
<script language="JavaScript" type="text/javascript">
<!--
var delta=0.8;
var collection;
var closeB=false;
function floaters() {
this.items = [];
this.addItem = function(id,x,y,content)
{
document.write('<DIV id='+id+' style="Z-INDEX: 10; POSITION: absolute;    width:80px; height:60px;left:'+(typeof(x)=='string'?eval(x):x)+';top:'+(typeof(y)=='string'?eval(y):y)+'">'+content+'</DIV>');
var newItem      = {};
newItem.object     = document.getElementById(id);
newItem.x      = x;
newItem.y      = y;
this.items[this.items.length]    = newItem;
}
this.play = function()
{
collection      = this.items
setInterval('play()',30);
}
}
function play()
{
if(screen.width<=800 || closeB)
{
for(var i=0;i<collection.length;i++)
{
collection[i].object.style.display = 'none';
}
return;
}
for(var i=0;i<collection.length;i++)
{
var followObj    = collection[i].object;
var followObj_x    = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);
var followObj_y    = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));
followObj.style.left=followObj.offsetLeft+dx;
}
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));
followObj.style.top=followObj.offsetTop+dy;
}
followObj.style.display = '';
}
}
function closeBanner()
{
closeB=true;
return;
}
var theFloaters    = new floaters();
//
theFloaters.addItem('followDiv1','document.body.clientWidth-106',80,'<embed src="http://blog.gulu77.com/demo/flash/dl.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="300"></embed><a style="text-align:left; cursor: hand; display:block; background:#eee; width:100px;" onClick="closeBanner();">关闭</a>');
theFloaters.addItem('followDiv2',6,80,'<embed src="http://blog.gulu77.com/demo/flash/dl.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="100" height="300"></embed><a style="text-align:left; cursor: hand; display:block; background:#eee; width:100px;" onClick="closeBanner();">关闭</a>');
theFloaters.play();
-->
</script>
<script src="http://blog.gulu77.com/demo/style/js/copyrightdemo.js" type="text/javascript"></script>
</body>
</html>
 

4.带关闭对联广告(随屏幕滚动:单关闭

<html>
<head>
<title>带关闭对联广告(随屏幕滚动:单关闭</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
*{ margin:0; padding:0;}
body{ text-align:center; font-size:12px;}
-->
</style>
</head>
<body>
<div style="margin:auto; padding:20px 0; width:770px; height:1500px; background:#eee; position:relative; line-height:200%;">
带关闭对联广告(随屏幕滚动:单关闭)<br/>
</div>
<script language="JavaScript" type="text/javascript">
lastScrollY=0;
function heartBeat(){
var diffY;
if (document.documentElement && document.documentElement.scrollTop)
diffY = document.documentElement.scrollTop;
else if (document.body)
diffY = document.body.scrollTop
else
{/*Netscape stuff*/}
//alert(diffY);
percent=.1*(diffY-lastScrollY);
if(percent>0)percent=Math.ceil(percent);
else percent=Math.floor(percent);
document.getElementById("LeftAd").style.top=parseInt(document.getElementById("LeftAd").style.top)+percent+"px";
document.getElementById("RightAd").style.top=parseInt(document.getElementById("LeftAd").style.top)+percent+"px";
lastScrollY=lastScrollY+percent;
//alert(lastScrollY);
}
suspendcode12="<DIV id=LeftAd style='left:5px;POSITION:absolute;TOP:80px;'><embed src='http://blog.gulu77.com/demo/flash/dl.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='100' height='300'><a style='text-align:left; cursor: hand; display:block; background:#eee; width:100px;' href='javascript:void(0)' onclick='javascript:ClosedivLeft()' hidefocus='true'>关闭</a></div>"
suspendcode14="<DIV id=RightAd style='right:5px;POSITION:absolute;TOP:80px;'><embed src='http://blog.gulu77.com/demo/flash/dl.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='100' height='300'></embed><a style='text-align:left; cursor: hand; display:block; background:#eee; width:100px;' href='javascript:void(0)' onclick='javascript:ClosedivRight()' hidefocus='true'>关闭</a></div>"
document.write(suspendcode12);
document.write(suspendcode14);
window.setInterval("heartBeat()",1);
function ClosedivLeft()
{
LeftAd.style.visibility="hidden";
}
function ClosedivRight()
{
RightAd.style.visibility="hidden";
}
</script>
<script src="http://blog.gulu77.com/demo/style/js/copyrightdemo.js" type="text/javascript"></script>
</body>
</html>

免责声明:本文由静落凝封整理发布,版权归原作者所有,转载请注明出处,如有侵权请联系管理员删除

热门文章

Linux中升级更新命令yum update和yum upgrade的区别

Linux中升级更新命令yum update和yum upgrade的区别

Linux中升级更新命令yum update和yum upgrade的区别,yum -y update:升级所有包同时也升级软件和系统内核;yum -y upgrade:只升级所有包,不升级软件和系统内核。...

网页中文简体繁体转换JS代码

网页中文简体繁体转换JS代码

要在网页上实现中文简体和繁体之间的转换,可以使用JavaScript库,以下是我在网络上收集整理的网页中文简体繁体转换JS代码,供收藏,以备用。代码有点多,就不直接贴代码了,自行下载测试哈...

通过脚本文件自动更新Linux实例中的软件源

通过脚本文件自动更新Linux实例中的软件源

本文主要介绍通过脚本文件更新Linux实例中的软件源的方法。如果您对实例或数据有修改、变更等风险操作,务必注意实例的容灾、容错能力,确保数据安全。如果您对实例等进行配置与数据修改,建...

在CentOS系统的ECS实例中配置OpenVPN

在CentOS系统的ECS实例中配置OpenVPN

在安装OpenVPN服务前,请确保完成如下准备工作。请参考如下文档,将YUM源更新为阿里云的YUM源。如何通过工具自动更新Linux实例中的软件源。依次执行如下命令,安装依赖的软件包。yum instal...

Linux 自动注销设置 TMOUT

Linux 自动注销设置 TMOUT

对所有用户设置自动注销功能:首先,以root用户登录系统,输入 vi /etc/profile 命令,编辑profile文件。查找TMOUT,若没有,则可以在文件最后添加如下语句:TMOUT=300 export TOMOUT 如果查...