滑动菜单

WzSzm 2010-01-18 10:30:45
在页面最底部,当鼠标移到某个标志时会滑出菜单。鼠标移走时菜单收回去!
...全文
102 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq276402087 2010-01-21
  • 打赏
  • 举报
回复


alert("上樓很牛叉!!");

nta5107179 2010-01-19
  • 打赏
  • 举报
回复
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN">
<head>
<style type="text/css">
#ToolBar {
position:absolute;
bottom:0px;
right:0px;
width:100%;
height:100px;
background:#ccc;
z-index:3;
overflow:hidden;
}
#ToolBar2 {
position:absolute;
left:0px;
width:100%;
height:100px;
background:#ffffff;
}
</style>
<script language="javascript">
var over;
var out;
function overs(){
var ToolBar2=document.getElementById("ToolBar2");
var top=ToolBar2.style.top;
top=parseInt(top.replace("px"));
if(top>0){
ToolBar2.style.top=(top-5)+"px";
}else{
clearInterval(over);
}
ToolBar2=null;top=null;
}
function outs(){
var ToolBar2=document.getElementById("ToolBar2");
var top=ToolBar2.style.top;
top=parseInt(top.replace("px"));
if(top<100){
ToolBar2.style.top=(top+5)+"px";
}else{
clearInterval(out);
}
ToolBar2=null;top=null;
}
function overstart(){
clearInterval(out)
over=setInterval(overs,20);
}
function outstart(){
clearInterval(over)
out=setInterval(outs,20);
}
</script>
</head>
<body>
<div id="ToolBar">
<div id="ToolBar2" style="top:100px;">我出来啦</div>
</div>
<label onmouseover="overstart();" onmouseout="outstart();">鼠标放上来</label>
</body>

</html>

这效果?
zhyzdl 2010-01-19
  • 打赏
  • 举报
回复
study
liu2835993 2010-01-19
  • 打赏
  • 举报
回复
菜单什么样式啊? 菜单假设为一个div默认display:none;

在某个标志上 添加 onmouseout、onmouseover上添加div的隐藏与显示即可

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧