资料
表格
制度
合同
管理
职场
经营
创业
范文
总结
计划
作文
文章
美文
词句
教程
模板
图片
字体
图标
办公
人事
财务
生产
管理资源吧首页
>>>
教程
>>>
编程
>>>
JavaScript教程
>>>
模仿Flash AS效果的导航菜单
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>模仿Flash AS效果的导航菜单</title> <style type="text/css"> <!-- a:link,a:visited { text-decoration: none; color: #666666 } a:hover { text-decoration: underline } #hor1 { position:absolute; left:320px; top:20px; width:220px; height:20px; z-index:1; background-color: #999900; } #hor2 { position:absolute; left:320px; top:40px; width:220px; height:20px; z-index:2; background-color: #FFCC00; } #hor3 { position:absolute; left:320px; top:60px; width:220px; height:20px; z-index:3; background-color: #99CC00; } #board1 { position:absolute; left:320px; top:40px; width:220px; height:120px; z-index:-100; background-color: #333333; visibility: hidden; } body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; color: #FFFFFF; font-weight: bold; } body { background-color: #666666; } #board2 { position:absolute; left:320px; top:60px; width:220px; height:120px; z-index:-90; background-color: #333333; visibility: hidden; } #board3 { position:absolute; width:220px; height:120px; z-index:-80; left: 320px; top: 80px; background-color: #333333; visibility: hidden; } #hor4 { position:absolute; left:320px; top:80px; width:220px; height:20px; z-index:4; background-color: #99CCCC; } #board4 { position:absolute; left:320px; top:100px; width:220px; height:120px; z-index:-70; background-color: #333333; visibility: hidden; } --> </style> <img src="/_New/_cj/myeditor/sysimage/space.gif" class="ewebeditor__script" _ewebeditor_fake_tag="script" _ewebeditor_fake_value="%3Cscript%20type%3D%22text%2Fjavascript%22%3E%20%0D%0AlastNo%3D0%20%0D%0Afunction%20re(menu_no)%7B%20%0D%0Aif(lastNo!%3Dmenu_no)%7B%20%0D%0Acur%3Dmenu_no%2B1%20%0D%0AlastNo%3Dmenu_no%20%0D%0Arest()%20%0D%0A%7Delse%7B%20%0D%0Acur%3D100%20%0D%0A%7D%20%0D%0Adocument.getElementById(%22board%22%2Bmenu_no).style.visibility%3D%22visible%22%20%0D%0A%7D%20%0D%0Afunction%20rest()%7B%20%0D%0Afor(i%3D1%3Bi%3C%3D4%3Bi%2B%2B)%7B%20%0D%0Adocument.getElementById(%22hor%22%2Bi).style.top%3D20*i%3B%20%0D%0Adocument.getElementById(%22board%22%2Bi).style.visibility%3D%22hidden%22%20%0D%0A%7D%20%0D%0Amenu_num%3D4%3B%20%0D%0Aact%3D1%20%0D%0Aheight%3D120%2B20%20%0D%0Aspeed%3D0%3B%20%0D%0AposY%3D0%3B%20%0D%0A%7D%20%0D%0Afunction%20huke()%7B%20%0D%0Aif(act%3D%3D1%26%26cur%3C100)%7B%20%0D%0Aspeed%3D(height-posY)*0.69%2Bspeed*0.6%20%0D%0AposY%2B%3Dspeed%20%0D%0Afor(i%3Dcur%3Bi%3C%3Dmenu_num%3Bi%2B%2B)%7B%20%0D%0Adocument.getElementById(%22hor%22%2Bi).style.top%3DposY%2B(i-2)*20%20%0D%0A%7D%20%0D%0Aif(Math.abs(height-posY)%3C0.5)%7B%20%0D%0Afor(i%3Dcur%3Bi%3C%3Dmenu_num%3Bi%2B%2B)%7B%20%0D%0Adocument.getElementById(%22hor%22%2Bi).style.top%3Dheight%2B(i-2)*20%20%0D%0A%7D%20%0D%0Aact%3D0%20%0D%0A%7D%20%0D%0AsetTimeout(%22huke()%22%2C50)%20%0D%0A%7D%20%0D%0A%7D%20%0D%0A%0D%0A%3C%2Fscript%3E"> </head> <body> <div id="hor1" onclick="re(1);huke()">News</div> <div id="hor2" onclick="re(2);huke()">Populor</div> <div id="hor3" onclick="re(3);huke()">Sports</div> <div id="hor4" onclick="re(4);huke()">Woman</div> <div id="board1">1.由AS而想起Javascript 2.用Jscript写ASP有没有先天性的不足? 3.没有了。</div> <div id="board2">1.xhtml+css真的来了吗? 2.Flash取代传统网站 3.Flash何时才能连接数据库?</div> <div id="board3">1.程序员与小姐的10个相同。 2.中国的程序员与中国的足球?</div> <div id="board4">1.二十一世纪最缺的是什么?人才 <a href="<a href=" _ewebeditor_ta_href="%3Ca%20href%3D"http://linkweb.cn/js" target="_blank">http://linkweb.cn/js</a>" target="_blank"><a href="http://linkweb.cn/js" _ewebeditor_ta_href="http%3A%2F%2Flinkweb.cn%2Fjs" target="_blank">http://linkweb.cn/js</a></a></div> </body> </html>
[Ctrl+A 全选 注:
如需引入外部Js需刷新才能执行
]
教程首页
更多教程