爱易网
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 浏览次数:20334 次
以下是程序代码
<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
上一篇:狡猾的按钮特效
下一篇:常用的隐藏式目录菜单
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
苏宁易购成世界最慢电商 专家称其涉嫌违约
从3G牌照发放看中国4G规划效果
百度透露无人驾驶战略 研发三维交通地图
史玉柱此刻离任:营销巨匠为新游戏炒作?
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
承载京东C2C野心的拍拍网:梦想丰满,现实骨感
埃里克杰克森:阿里IPO估值至少1500亿美元
苹果CEO抱歉解读:是战略而非“屈服”
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
推荐阅读
更多>
雅安地震救灾前线的科技之手 微弱而暖和
网络文学竞争白热化 百度多酷文学网上线
微软大幅调整Bing在华策略:从高大上到接地气
618首日看京东阿里不同策略,鹿死谁手?
网络视频的几大趋势将成视频玩家躲不开的发力点
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
英特尔VS苹果:移动芯片大战
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
iPhone 6将于10月17日内地上市:售5288元起
携程整合去哪儿陷入僵局 欲联手老对手艺龙
玩游戏式的趣味戒烟App:Kwit
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
雷军收买腾讯金山股份:持股比例升至27%
同为70前后人,马云为什么总是像外星人那么瘦
史玉柱谈创业:5大建议 失败的教训最真实
中国雅虎邮箱今日关停 由盛及衰的背后
联想架构调整后:Think品牌或推智能手机
搜房网遭遇做空 利益保送成“猎杀”焦点
三星起诉LG在冰箱广告中玷污其企业笼统
阿里入股虎嗅:媒体的脊梁弯了?未必!