教程集 www.jiaochengji.com
教程集 >  脚本编程  >  javascript  >  正文 类qq下拉菜单 代码

类qq下拉菜单 代码

发布时间:2016-11-26   编辑:jiaochengji.com
教程集为您提供类qq下拉菜单 代码等资源,欢迎您收藏本站,我们将为您提供最新的类qq下拉菜单 代码资源
提示:您可以先修改部分代码再运行

<textarea name="runcool" rows="28" cols="75" ><html> <head> <title>QQ菜单</title> <meta http-equiv='Content-Type' content='text/html; charset=gb2312'> <script language='JavaScript'> var headHeight = 22;var bodyHeight = 202;var objcount = 2;var step = 10;var moving = false; function showme(obj1, obj2) { if (moving) return; moving = true; for(i=0;i<document.all.tags('td').length;i ) if (document.all.tags('td')[i].className.indexOf('headtd') == 0) document.all.tags('td')[i].className = 'headtd1'; obj2.className = 'headtd2'; moveme(obj1); } function moveme(obj) { idnumber = parseInt(obj.id.substr(4)); objtop = headHeight * (idnumber - 1); objbuttom = bodyHeight headHeight * (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 = headHeight * (countid - 1); if (countid == idnumber) { moveup(obj,objtop,false); break; } else moveup(obj,objtop,true); countid ; } } else if ((currenttop <= objtop) && (idnumber < objcount)) { idnumber ; countid = objcount; 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 headHeight * (countid - 2); if (countid == idnumber) { movedown(obj,objbuttom,false); break; } else movedown(obj,objbuttom,true); countid--; } } } function moveup(obj,objtop,ismove) { currenttop = parseInt(obj.style.top); if (currenttop > objtop) { obj.style.top = currenttop - step; setTimeout('moveup(' obj.id ',' objtop ',' ismove ')',1) return; } moving = ismove; } function movedown(obj,objbuttom,ismove) { currenttop = parseInt(obj.style.top); if (currenttop < objbuttom) { obj.style.top = currenttop step; setTimeout('movedown(' obj.id ',' objbuttom ',' ismove ')',1) return; } moving = ismove; } </script> </script> <style type='text/css'> .headtd1 { background: #00A4E1; border: 2px outset; border-color: #00BBFF #0077FF #0077FF #00BBFF; cursor: hand; font-size: 9pt}.headtd2 { background: #20C1FF; border: 2px outset; border-color: #60D3FF #0077FF #0077FF #60D3FF; cursor: hand; font-size: 9pt}.bodytd { background: #99CCFF; border: 2px outset; border-color: #B0D8FF #0077FF #0077FF #B0D8FF; font-size: 9pt} </style> </head> <body bgcolor='#FFFFFF' text='#000000'>
<table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item1head' height='20' class='headtd2' onclick='showme(item1body,this)' align='center'>菜单1</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table>
<table width='100%' border='0' height='100%' cellpadding='2' cellspacing='0'><tr><td id='item2head' height='20' class='headtd1' onclick='showme(item2body,this)' align='center'>菜单2</td></tr><tr><td class='bodytd' align='center'>test</td></tr></table>
</body></html></textarea>
提示:您可以先修改部分代码再运行

您可能感兴趣的文章:
jQuery菜单插件 Smooth Navigational Menu
js 仿QQ下拉菜单
导航菜单-横竖结合的折叠下拉导航菜单效果
QQ浏览器设置默认下载工具的方法
Jquery带搜索框的下拉菜单
Jquery下拉菜单(jquery 下拉菜单插件Sexy Drop Down Menu)
类qq下拉菜单 代码
jQuery ul标签下拉菜单演示代码
怎么查看别人QQ聊天记录
jquery下拉菜单 ul标签下拉菜单的例子

[关闭]
~ ~