最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 网页JS特效 > 图形图象类

网页左侧慢慢移动展开到右侧的对联广告代码

日期:02-07    来源:中国设计秀    作者:cnwebshow.com

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">N6e中国设计秀
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-cn">N6e中国设计秀
<head>N6e中国设计秀
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">N6e中国设计秀
<meta http-equiv="Content-Language" content="zh-CN" />N6e中国设计秀
<meta content="all" name="robots" />N6e中国设计秀
<title>从左至右慢慢移动展开的符合WEB标准的对联广告  www.cnwebshow.com</title>N6e中国设计秀
</head>N6e中国设计秀
<body>N6e中国设计秀
<SCRIPT language="JavaScript">N6e中国设计秀
var delta=0.015;N6e中国设计秀
var collection;N6e中国设计秀
var closeB=false;N6e中国设计秀
function floaters() {N6e中国设计秀
this.items = [];N6e中国设计秀
this.addItem = function(id,x,y,content)N6e中国设计秀
{N6e中国设计秀
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>');N6e中国设计秀
var newItem    = {};N6e中国设计秀
newItem.object   = document.getElementById(id);N6e中国设计秀
newItem.x    = x;N6e中国设计秀
newItem.y    = y;N6e中国设计秀
this.items[this.items.length]  = newItem;N6e中国设计秀
}N6e中国设计秀
this.play = function()N6e中国设计秀
{N6e中国设计秀
collection    = this.itemsN6e中国设计秀
setInterval('play()',30);N6e中国设计秀
}N6e中国设计秀
}N6e中国设计秀
function play()N6e中国设计秀
{N6e中国设计秀
if(screen.width<=800 || closeB)N6e中国设计秀
{N6e中国设计秀
for(var i=0;i<collection.length;i++)N6e中国设计秀
{N6e中国设计秀
collection[i].object.style.display = 'none';N6e中国设计秀
}N6e中国设计秀
return;N6e中国设计秀
}N6e中国设计秀
for(var i=0;i<collection.length;i++)N6e中国设计秀
{N6e中国设计秀
var followObj  = collection[i].object;N6e中国设计秀
var followObj_x  = (typeof(collection[i].x)=='string'?eval(collection[i].x):collection[i].x);N6e中国设计秀
var followObj_y  = (typeof(collection[i].y)=='string'?eval(collection[i].y):collection[i].y);N6e中国设计秀
if(followObj.offsetLeft!=(document.body.scrollLeft+followObj_x)) {N6e中国设计秀
var dx=(document.body.scrollLeft+followObj_x-followObj.offsetLeft)*delta;N6e中国设计秀
dx=(dx>0?1:-1)*Math.ceil(Math.abs(dx));N6e中国设计秀
followObj.style.left=followObj.offsetLeft+dx;N6e中国设计秀
}N6e中国设计秀
if(followObj.offsetTop!=(document.body.scrollTop+followObj_y)) {N6e中国设计秀
var dy=(document.body.scrollTop+followObj_y-followObj.offsetTop)*delta;N6e中国设计秀
dy=(dy>0?1:-1)*Math.ceil(Math.abs(dy));N6e中国设计秀
followObj.style.top=followObj.offsetTop+dy;N6e中国设计秀
}N6e中国设计秀
followObj.style.display = '';N6e中国设计秀
}N6e中国设计秀
}N6e中国设计秀
function closeBanner()N6e中国设计秀
{N6e中国设计秀
closeB=true;N6e中国设计秀
return;N6e中国设计秀
}N6e中国设计秀
var theFloaters  = new floaters();N6e中国设计秀
//N6e中国设计秀
theFloaters.addItem('followDiv1','document.body.clientWidth-100',0,'<a onClick="closeBanner();" href=http://www.cnwebshow.com target=_blank><img src=/uploadfile/2010/0211/20100211044605322.jpg  border=0></a><br><br><a href="javascript:closeBanner();" title="关闭上面的广告">×</a>');N6e中国设计秀
theFloaters.addItem('followDiv2',0,0,'<a onClick="closeBanner();" href=http://www.cnwebshow.com target=_blank><img src=/uploadfile/2010/0211/20100211044605322.jpg border=0 ></a><br><br><a href="javascript:closeBanner();" title="关闭上面的广告">×</a>');N6e中国设计秀
theFloaters.play();N6e中国设计秀
</SCRIPT>N6e中国设计秀
<p>如果看不到,重新刷新一下看看</p>N6e中国设计秀
</body>N6e中国设计秀
</html>N6e中国设计秀

本文引用地址:/js/article_63456.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明