原创javascript实现滚动菜单一例(小弟弟初入此地,试发文章一篇)

类别:网站制作 点击:0 评论:0 推荐:
菜单 var headHeight = 22;var bodyHeight = 220;var objcount = 6;var step = 20;var moving = false; function showme(obj1, obj2) { if (moving) return; moving = true; for(i=0;i= objbuttom) { countid = 1; for(i=0;i= 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; } function remenu() { document.all.outmenu.style.visibility = "visible" parent.menu1.cols= "18,*" ; } function remenu1(){ document.all.outmenu.style.visibility = "hidden" parent.menu1.cols= "150,*" ; } //判断是否真的要退出系统 function closeWin() { if (confirm("您确定要退出系统吗?")) { window.close(); } } 菜单组一 菜单项1 菜单项2 菜单项3 菜单项4 菜单项5         菜单组二 菜单项1 菜单项2 菜单项3 菜单项4 菜单项5         菜单组三 菜单项1 菜单项2 菜单项3 菜单项4 菜单项5         菜单组四 菜单项1 菜单项2 菜单项3 菜单项4 菜单项5         菜单组五 菜单项1 菜单项2 菜单项3 菜单项4 菜单项5 退出

本文地址:http://com.8s8s.com/it/it30704.htm