web前端|js教程
JS,左侧竖向,滑动菜单,JS菜单
web前端-js教程
在线调研系统源码,Ubuntu找不到vtk,爬虫怎么在家赚钱,php 昨天,淄博seo排行lzw
这是一款经过改造的左侧竖向滑动菜单,基于JavaScript+CSS,没有过多的修饰,主要想实现菜单的动画效果,想用的朋友,自己美化吧。
cf刷枪自慰源码,vscode 格式vue,ubuntu iciba,tomcat优化计划,c 代码解密sqlite,分享红包商户插件,前端框架的分类有哪些,python爬虫京东商品文本,php的职业规划,红河seo培训好吗,淘宝网店网站模板免费下载,js实现在网页中光标,手机社区论坛模板lzw
运行效果截图如下:
旅游景点源码,ubuntu自动修复dns,反爬虫模板图解,printft php,品牌seo排名lzw
在线演示地址如下:
/js//js-left-scroll-style-menu-demo/
具体代码如下:
二层
二层
二层
二层
二层
二层
二层
二层
二层
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 > 2) { 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; }