小语教师验证| 初语教师验证|扬州教师验证|快速获积分| 宣传获积分 微信宣传得积分| 积分换VIP |积分来源
唐老师网站
唐老师网站提供免费义务教育阶段语文教学资源库服务。有希望合作者,请联系我们。 合作内容:1.资源共同开发、宣传、使用。2.网络与语文教学结合技术支持。3.宣传推荐学校、机构、个人及产品。4.为本站用户提供免费产品或服务。5.其他合作内容。

TOP

可以拖动的菜单代码
2012-08-20 11:20:47 来源:唐老师网站 作者: 【 】 浏览:965次 吐槽:0
最近浏览过的会员: (查看更多)

<!--要完成此效果需要两个步骤-->

<!--第一步:把如下代码加入到<body>区域中-->

<style>
body,td,a {font-size:9pt;color:black}
.none{border:black 1px solid;background:D9D9D9;padding-top:2}
.over {border:black 1px solid;background:707888;color:white;padding-top:2}
</style>
<div style="position:absolute; left: 100; top: 200; width: 1; height: 1;cursor: hand" ID=plane onmousedown="down=true;divleft=event.clientX-parseInt(plane.style.left);divtop=event.clientY-parseInt(plane.style.top)"onmouseup="down=false">
<div align=center style="position:absolute; left:220px; top:3px; width:100px; height:19px; z-index:1;color:white;background:707888;cursor:move"onmouseover='stopTimerline();menuItemIn()' onmouseout='runTimerline()' class="none">可拖动的菜单</div>
<div align=center id="item11" style="position:absolute; left:120px; top:25px; width:99px; height:19px; z-index:2; filter:alpha(opacity=0)" onmouseover="this.className='over';stopTimerline()"
onmouseout="this.className='none';runTimerline()" class="none"
>菜单项一</div>
<div align=center id="item12" style="position:absolute; left:320px; top:47px; width:99px; height:19px; z-index:3;filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';stopTimerline()"
onmouseout="this.className='none';runTimerline()">菜单项二</div>  <div align=center id="item13" style="position:absolute; left:120px; top:69px; width:99px; height:19px; z-index:4; filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';stopTimerline()"
onmouseout="this.className='none';runTimerline()">菜单项三</div>
<div align=center id="item14" style="position:absolute; left:320px; top:91px; width:99px; height:19px; z-index:5;filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';stopTimerline()"
onmouseout="this.className='none';runTimerline()">菜单项四</div>  <div align=center id="item15" style="position:absolute; left:120px; top:113px; width:99px; height:19px; z-index:6; filter:alpha(opacity=0)"
class=none onmouseover="this.className='over';stopTimerline()"
onmouseout="this.className='none';runTimerline()">菜单项五</div>
</div><script>
//动画菜单
var currTimerlinePoint=0
var totalTimerlineFrames=2
var timerlineTimer
var leftLine = 50
var timerIn
var timerOut
var timerlineArray = new Array()
timerlineArray[0]=''
timerlineArray[1]='menuItemOut()'
function runTimerline()
{
window.timerlineTimer = setTimeout('menuItemOut()',500)
}
function stopTimerline()
{
clearTimeout(window.timerlineTimer)
}
function menuItemIn()
{
if( leftLine != 150)
{
item11.style.pixelLeft += 20; item11.filters.alpha.opacity += 20
item12.style.pixelLeft -= 20; item12.filters.alpha.opacity += 20
item13.style.pixelLeft += 20; item13.filters.alpha.opacity += 20
item14.style.pixelLeft -= 20; item14.filters.alpha.opacity += 20
item15.style.pixelLeft += 20; item15.filters.alpha.opacity += 20
leftLine += 20
}
else
{
clearTimeout(window.timerIn)
return false
}
timerIn=window.setTimeout('menuItemIn()',1)
}
function menuItemOut()
{
clearTimeout(window.timerIn)
if (leftLine != 50)
{
item11.style.pixelLeft -= 20; item11.filters.alpha.opacity -= 20
item12.style.pixelLeft += 20; item12.filters.alpha.opacity -= 20
item13.style.pixelLeft -= 20; item13.filters.alpha.opacity -= 20
item14.style.pixelLeft += 20; item14.filters.alpha.opacity -= 20
item15.style.pixelLeft -= 20; item15.filters.alpha.opacity -= 20
leftLine -= 20
}
else
{
clearTimeout(window.timerOut)
return false;
}
timerOut=window.setTimeout("menuItemOut()",1)
}
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
//移动层
var over=false,down=false,divleft,divtop;function move(){if(down){plane.style.left=event.clientX-divleft;plane.style.top=event.clientY-divtop}}
</script>


<!--第二步:把“onmousemove="move()"”加在<body>标记里,例如:-->
<body onmousemove="move()">

相关搜索
41
Tags:可以 菜单 代码 分享网友:admin
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【吐槽】 【关闭】 【返回顶部
分享到QQ空间
分享到: 
上一篇<!--浏览器检测后自动调相应页.. 下一篇礼花效果 代码

坚持党对教育事业的全面领导,坚持把立德树人作为根本任务,坚持优先发展教育事业.

相关栏目

最新文章

内容加载中,请稍候...

图片主题

内容加载中,请稍候...

热门文章

内容加载中,请稍候...

推荐文章

内容加载中,请稍候...

相关文章

内容加载中,请稍候...

贡献者排行榜(感谢“唐老师们”)

您正在浏览:可以拖动的菜单代码 需要更多请站内搜索,还是没有请免费向我们索取。
唐老师网站**********************一线语文教师互动分享***************部编版统编语文
关于本站 ----广告服务---版权申明---联系我们---网站地图 --
本网大部分资源来源于会员上传,除本网组织的资源外,版权归原作者所有,如有侵犯版权,请立刻和本网联系并提供证据,本网将在三个工作日内改正。
Copyright © 2009 - 2013 520yuwen. All Rights Reserved 工信部备案苏ICP备05032846-1号
站长:唐桂荣

苏公网安备 32100302010062号

本站与www.yz110.com同为“唐老师网站”旗下网站。