下拉滑动门
来源:互联网 发布:mac系统镜像文件下载 编辑:程序博客网 时间:2024/04/30 14:29
<!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"> <head> <title> 下拉滚动门 </title> <style type="text/css"> body{ margin:10px; padding:10px; } body,td,div,span,li{ font-size:12px; } .title01,.title02{ color:#fff; font-weight:bold; } #DoorP{ border:12px solid #eee; width:150px; height:300px; padding:4px; background:#fff; } .title01{ width:100%; height:25px; background:#00ccff; cursor:pointer; } .title02{ width:100%; height:25px; background:#99cc00; cursor:pointer; } .content{ background:#eee; border-bottom:2px solid #fff; overflow:hidden; color:#666; padding-left:4px; padding-right:4px; line-height:18px; } </style> <!-- 棕:#eee; 蓝:#00ccff; 绿:#99cc00; --> </head> <body> <div id="DoorP"> <table> <tr> <td> 第一层信息 </td> </tr> </table> <div class="content"> 十三妖<br/> 十三妖<br/> 十三妖<br/> </div> <table> <tr> <td> 第二层信息 </td> </tr> </table> <div class="content"> ThirdteenDevil </div> <table> <tr> <td> 第三层信息 </td> </tr> </table> <div class="content"> devil13th </div> </div> <script type="text/javascript"> var open = 2;// 设置初始打开的层序号 var openState = new Array(); var closeState = new Array(); var dH = 220; function $(id){ if(document.getElementById(id)) { return document.getElementById(id); } else { alert("没有找到!"); } } function $tag(id,tagName){ return $(id).getElementsByTagName(tagName) } function closeMe(Cid,Oid){ var h = parseInt(Ds[Cid].style.height); //alert(h); if(h > 0) { h = h - Math.ceil(h/3); Ds[Cid].style.height = h+"px"; } else { openMe(Oid); clearTimeout(closeState[Cid]); return false; } closeState[Cid] = setTimeout("closeMe("+Cid+","+Oid+")"); } function openMe(Oid){ var h = parseInt(Ds[Oid].style.height); //alert(h); if(h < dH) { h = h + Math.ceil((dH-h)/3); Ds[Oid].style.height = h+"px"; } else { clearTimeout(openState[Oid]); return false; } openState[Oid] = setTimeout("openMe("+Oid+")"); } var Ds = $tag("DoorP","div"); var Ts = $tag("DoorP","table"); if(Ds.length != Ts.length) { alert("标题和内容数目不相同!"); } for(var i = 0 ; i < Ds.length ; i++) { if(i==open) { Ds[i].style.height = dH+"px"; Ts[i].className="title01"; } else { Ds[i].style.height = "0px"; Ts[i].className="title02"; } Ts[i].value = i; Ts[i].onclick = function(){ if(open==this.value) { return false; } Ts[open].className="title02"; Ts[this.value].className="title01"; for(var i = 0 ; i < openState.length ; i++) { clearTimeout(openState[i]); clearTimeout(closeState[i]); } closeMe(open,this.value); //openMe(this.value); open = this.value; } } //直接打开层函数 function showDiv(id){ Ds[id].style.height=dH+"px"; Ds[open].style.height="0px"; open = id; } //渐渐打开层函数 </script> </body> </html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
第一层信息
十三妖
十三妖
十三妖
第二层信息 十三妖
十三妖
ThirdteenDevil
第三层信息 devil13th
- 下拉滑动门
- UIPanGestureRecognizer 左右滑动卡片,下拉滑动就是下拉刷新
- JQuery 下拉框滑动效果
- 下拉刷新和viewPager左右滑动冲突,下拉刷新和banner滑动布局滑动冲突
- Android Scroll实现弹性滑动 一 列表下拉弹性滑动
- SwipeRefreshLayout下拉刷新跟listview下拉滑动冲突解决
- jquery中向下滑动下拉框
- 高仿QQlistview滑动删除+下拉刷新
- UL下拉列表 调出滑动条
- UICollectionView的下拉刷新无法滑动
- Android 下拉刷新 左右滑动 事件冲突
- 自定义简单实现滑动下拉刷新效果
- 网页ad广告图下拉定点滑动
- 玩转 H5 下拉上滑动效
- 下拉滑动二级导航菜单demo
- RecyclerView的滑动删除以及下拉加载
- ExpandTable手写点击下拉滑动模块
- ios下拉效果滑动滚出页面
- Seasar2 2.新建项目说明
- boost regex 超详细教程
- 云计算之存储即服务-结构化数据存储(1)
- 位图文件(BMP)格式分析以及程序实现
- 【Cortex-M0】17模拟数字转换
- 下拉滑动门
- build taintdroid2.3 for emulator
- 【Cortex-M0】18 RTX Kernel实时系统
- 云计算之存储即服务-结构化数据存储(2)
- ajax乱码解决
- make menuconfig错误Unable to find the ncurses libraries
- c# ftp 目录下载
- Android Bitmap和Canvas学习笔记
- 【Cortex-M0】19.1 详解startup_M051.s