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>
|