首页
微信
安卓
接口
移动
前端
专题
文档库
工具
网址
§
ITPOW
>>
文档
>>
JavaScript
>>
菜单导航
推门式菜单
作者: 来源: 日期:2004-9-30
<script type="text/javascript"> <!-- speed=50; step=10; margin=15; width=100; var hideTimer,showTimer; //构造div document.write("<div id='div1' style='position:absolute;left:"+(margin-width)+";width:"+width+";top:200'>"); document.write("<table width='"+width+"' height='50' border='1' onmouseover='move(1)' onmouseout='move(-1)'>"); document.write("<tr><td width='100%' bgcolor='#CCCCCC'></td></tr></table></div>"); function move(dir) { if(dir==1) { clearInterval(hideTimer); showTimer=setInterval("show()",speed); } else { clearInterval(showTimer); hideTimer=setInterval("hide()",speed); } } function show() { if(document.all.div1.style.pixelLeft<0) { document.all.div1.style.pixelLeft+=step; } else clearInterval(showTimer); } function hide() { if((document.all.div1.style.pixelLeft+document.all.div1.style.pixelWidth)>margin) { document.all.div1.style.pixelLeft-=step; } else clearInterval(hideTimer); } --> </script>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
相关文章
创建于2005年
渝ICP备05010272号-1
电邮:
cftea@126.com
即将跳转...