实现广告收缩的代码
来源:互联网 发布:ubuntu squid 透明代理 编辑:程序博客网 时间:2024/04/28 02:14
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"s>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>仿163的广告收缩效果</title>
<style type="text/css">
#top{
position:relative;
}
#content{
position:absolute;
}
</style>
</head>
<body onload="moveDown()">
<div id="top" style="width:80%;heigth:500px;background-color:#F96">
这是网页的广告部分
</div>
<div id="content" style="width:80%;height:300px;background-color:#CC0">这是网页的正文部分</div>
</body>
</html>
<script language="javascript" type="text/javascript">
//定义一个步长
var h=0;
var maxheight=400;
var st;
var top=document.getElementById("top");
//初始时设置top为隐藏状态
top.style.display="none";
//定义广告部分
function moveDown(){
h+=2;
//设置显示
top.style.height=h+"px";
top.style.display="block";
if(h<maxheight){
st=setTimeout("moveDown()",40);
}else{
setTimeout("moveUp()",50);
}
}
//定义正文部分
function moveUp(){
h-=2;
top.style.height=h+"px";
top.style.display="block";
if(h<=0){
top.style.display="none";
clearTimeout(st);
}else{
//如果h大于0则继续收缩
setTimeout("moveUp()",50);
}
}
</script>
- 实现广告收缩的代码
- [JavaScript/JQuery] jquery实现的Banner广告收缩效果代码
- [JavaScript/JQuery] jquery实现滑屏大图定时收缩为小banner图片的广告代码
- JS实现防163首页的广告收缩效果
- 滑动展开-收缩广告代码实例效果
- 实现浮动广告的代码
- 仿163首页的广告收缩效果
- JS的实现两侧广告的代码
- 对联广告的jsp代码实现
- 收缩数据库日志的代码
- 滑动展开/收缩广告
- 最简单JS实现展开收缩代码
- jquery实现表格的收缩
- 仿163首页的广告收缩效果/菜单滑动/进度条
- 用javascript仿163首页的广告收缩效果~~~~~~
- 【JS】经典的对联广告代码,JS代码实现
- 漂浮广告的代码
- google广告的代码
- Sybase数据库备份报错
- cocos2d对动画的各种操作
- ubuntu下ROR安装选择单用户或多用户
- hadoop动态增加删除节点
- 在安装BIPublisherDesktop11.1.1.5.0时报请确保安装了JRE版本1.6或更高版本的错误
- 实现广告收缩的代码
- flex3 state和flex4 state的差异
- mysql修改密码
- JavaScript捕捉键盘按下的事件
- js 简单的类下拉菜单特效
- listView 添加多个不同的adapter
- C#无边框窗体的拖动
- 仿163首页广告伸缩效果
- Tips for using Oracle ADF (Application Development Framework)