| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 4738 人关注过本帖, 1 人收藏
标题:js特效:类似QQ的菜单
只看楼主 加入收藏
汤姆猫
Rank: 1
等 级:新手上路
威 望:1
帖 子:52
专家分:0
注 册:2006-10-16
收藏
得分:0 
图片附件: 游客没有浏览图片的权限,请 登录注册



JS的那段好象有点问题 怎么第二把三级菜单会被覆盖在第四级里面啊

新技术创造新生活!
2007-06-15 10:36
kkynietg
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2007-6-21
收藏
得分:0 
看看VBS的运行的效果
[CODE]
<HTML>
<HEAD>
<TITLE> menu </TITLE>
</HEAD>
<BODY>
<SCRIPT LANGUAGE="vbScript">
Dim layerWidth,layerHeight,titleHeight,contentHeight,itemIndex
itemIndex=1
layerWidth=120 '层的高度
layerHeight=220 '层的宽度
titleHeight=20 '标题栏的高度
contentHeight=200 '内容区的高度
temp=20 '每次移动的高度
itemCount=4 '总菜单数
Function addLayer(titleText,contentText)
Dim innerHtml
'生成每一层
innerHtml="<div id='Item" & itemIndex &"' style='top:" & temp & ";overflow:hidden;position:absolute;border-style:solid;border-color:#FF99FF;width:" & layerWidth & ";height:" & layerHeight & ";border-width:1px'><table border='0' cellpadding='0' cellspacing='0'><tr><td onclick='vbscript:changeMove(" & itemIndex & ")' style='font-size:9pt;color:#FFFFFF;background-color:#008800;width:" & layerWidth & ";height:" & titleHeight-2 & ";cursor:hand'><center>" & titleText & "</center></td></tr><tr><td style='height:1px;background-color:#FFFFFF'></td></tr><tr><td style='font-size:9pt;background-color:#eeffee;height:" & layerHeight+2 & "'>" & contentText & "</td></tr></table></div>"
Document.write(innerHtml)
itemIndex=itemIndex+1
temp=temp+20
End function
addLayer "欢迎","<BR>  欢迎光临设计在线!"
addLayer "网页陶吧","<center><a href='#'>网页工具</a> <BR><BR><a href='#'>技术平台</a> <BR><BR><a href='#'>设计理念</a> <BR><BR><a href='#'>更多</a></center>"
addLayer "美工教室","<center><a href='#'>平面设计 </a> <BR><BR><a href='#'>三维空间</a> <BR><BR><a href='#'>设计基础</a> <BR><BR><a href='#'>更多..</a></center>"
addLayer "Flash","<center><a href='#'>基础教程</a> <BR><BR><a href='#'>技巧运用</a> <BR><BR><a href='#'>实例剖析</a> <BR><BR><a href='#'>更多..</a></center>"'使层向下移动
Function moveDown(currentItem)
Dim i
For i=currentItem To itemCount
If Document.getElementById("Item" & i).style.height<>"20px" And i<>1 then
Document.getElementById("Item" & i).style.top=CInt(Replace(Document.getElementById("Item" & i).style.top,"px",""))+contentHeight
Document.getElementById("Item" & i).style.height="20px"
End if
next
End Function'使层向上移动
Function moveUp(currentItem)
Dim i
For i=currentItem To 1 Step -1
If Document.getElementById("Item" & i).style.height<>"220px" then
Document.getElementById("Item" & i).style.top=CInt(Replace(Document.getElementById("Item" & i).style.top,"px",""))-contentHeight
Document.getElementById("Item" & i).style.height=layerheight
End if
next
End Function
Function changeMove(currentItem)
'MsgBox Document.getElementById("Item" & currentItem).style.height
If Document.getElementById("Item" & currentItem).style.height="220px" Then
moveDown(currentItem)
Else
moveUp(currentItem)
End If
End Function
moveDown(1)</SCRIPT>
</BODY>
</HTML>

[/CODE]

[此贴子已经被作者于2007-6-21 12:06:04编辑过]

2007-06-21 11:59
lxdwwei
Rank: 2
等 级:论坛游民
帖 子:140
专家分:40
注 册:2007-7-9
收藏
得分:0 

两个牛人 啊


专业收购出售各类旧版人民币,纪念币等收藏品!
联系QQ:110666117 电话:18610655907
2007-07-16 17:06
lyshyhuangli
Rank: 1
等 级:新手上路
帖 子:29
专家分:0
注 册:2007-7-24
收藏
得分:0 
回复:(小笨笨)js特效:类似QQ的菜单

好啊!!

2007-08-01 17:57
fqbnet2008
Rank: 2
等 级:新手上路
威 望:4
帖 子:1020
专家分:0
注 册:2007-1-4
收藏
得分:0 
牛B,顶了 。

雄关漫道真如铁,而今迈步从头越,从头越,苍山如海,残阳如血㊣♀★
2007-09-12 09:41
shulei521521
Rank: 1
等 级:新手上路
帖 子:40
专家分:0
注 册:2007-8-7
收藏
得分:0 
怎么放成一排呀

2007-09-17 11:06
快速回复:js特效:类似QQ的菜单
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017814 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved