爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
类似QQ的竖型目录菜单
类似QQ的竖型目录菜单
日期:2014-05-18 浏览次数:20327 次
以下是程序代码
<html> <head> <title>类似QQ的竖型目录菜单,aiyiweb整理收集。</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="JavaScript"> var titleHeight = 22; //标题的高度 var bodyHeight = 160; //菜单内容项的高度 var groupcount = 4; //组的个数 var step = 3; //移动速度 //显示菜单的内容 function showDiv(obj1, obj2) { //以下循环为改变标题的背景颜色 for(i=0;i<document.all.tags("td").length;i++) { if (document.all.tags("td")[i].className == 'headtd') document.all.tags("td")[i].bgColor = '#cccc66'; } obj2.bgColor = '#cccc66'; moveme(obj1); } //移动菜单内容 function moveme(obj) { idnumber = parseInt(obj.id.substr(4)); objtop = titleHeight * (idnumber - 1); objbuttom = bodyHeight + titleHeight * (idnumber - 2); currenttop = parseInt(obj.style.top); if (currenttop >= objbuttom) { //检验出每一个应该向上移动的层 countid = 1; for(i=0;i<document.all.tags("div").length;i++) { if (document.all.tags("div")[i].id == 'item'+countid+'body') { obj = document.all.tags("div")[i]; objtop = titleHeight * (countid - 1); moveup(obj,objtop); if (countid == idnumber) break; countid++; } } } else if ((currenttop <= objtop) && (idnumber < groupcount)) { //检验出每一个应该向下移动的层 idnumber++; countid = groupcount; for(i=document.all.tags("div").length-1;i>=0;i--) { if (document.all.tags("div")[i].id == 'item'+countid+'body') { obj = document.all.tags("div")[i]; objbuttom = bodyHeight + titleHeight * (countid - 2); movedown(obj,objbuttom); if (countid == idnumber) break; countid--; } } } } //向上移动的方法 function moveup(obj,objtop) { currenttop = parseInt(obj.style.top); if (currenttop > objtop) { obj.style.top = currenttop - step; window.setTimeout('moveup('+obj.id+','+objtop+')',1) } } //向下移动的方法 function movedown(obj,objbuttom) { currenttop = parseInt(obj.style.top); if (currenttop < objbuttom) { obj.style.top = currenttop + step; window.setTimeout('movedown('+obj.id+','+objbuttom+')',1) } } </script> <style type="text/css"> <!--showme .headtd { border: 3px outset; border-color: #00bbFF #0007cc #0007cc #00aacc; cursor: hand; font-size: 10pt} .bodytd { background: gray; border: 2px outset; border-color: #00aaFF #0007cc #0007cc #00aacc; font-size: 10pt} --> </style> </head> <body bgcolor="#FFFFFF" text="#000000"> 告诉你一个应有尽有的网页特效网址:<a href="http://js.aiyiweb.com">http://js.aiyiweb.com</a> <hr /> <div id="mainboard" style="position:absolute; left:2px; top:2px; width:120px; height:226px; z-index:3; overflow: hidden; background-color: #cccc66;"> <div id="item1body" style="position:absolute; left:0; top:0; width:120px; height:160px; z-index:1; overflow: hidden"> <table width="100%" border="0" height="100%" cellpadding="2" cellspacing="0"> <tr> <td id="item1head" height="20" class="headtd" onclick="showDiv(item1body,this)" bgcolor="#cccc66"> <div align="center">爱易网群1</div> </td> </tr> <tr> <td class="bodytd"> <div align="center"><a
上一篇:狡猾的按钮特效
下一篇:常用的隐藏式目录菜单
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
中国移动4G资费调整方案6月1日起正式实施
窗口期:还有哪些互联网公司可能今年IPO?
二代 iPad Air将配备2GB内存?为同屏多任务做准备
任正非:华为决不上市 上市公司股东贪婪而短视
互联网金融一周年:余额宝最接地气,比特币最作死
英特尔VS苹果:移动芯片大战
O2O成"唐僧肉":百度糯米抢食第一口令阿里腾讯颤抖
马云自称在美国曾被绑票
佳能利润大跌三成 智能终端倒逼相机厂商转型
推荐阅读
更多>
美国政府关门可能影响去哪儿等公司IPO
Line风靡亚洲,在北美却进展缓慢
互联网情色众多 Facebook与9158态度大不同
只有切到刚需痛点,漫画APP才能走下去
清点:罗永浩推锤子ROM 小米打法遭模拟
苹果股价突破100美元大关:投资者看好iPhone 6
AMD Q1净亏1.46亿美元 转战SOC拥抱ARM求变
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
百度透露无人驾驶战略 研发三维交通地图
联想国庆完成收购IBM x86服务器
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
雷军收买腾讯金山股份:持股比例升至27%
阿朗力避步北电后尘 急切停止自我革新
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
PC迎9年来出货量新低 平板电脑渐成主流
网曝富士康“二连跳” 疑因推静音模式
“宽带中国”计划已正式上升为国家战略
前苹果顾问批判iPhone命名:不应加S
墨迹也要做硬件,工具类应用如何“变异”的