• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

模仿OUTLOOK的菜单

发布: 2007-6-30 18:56 | 作者: admin | 来源: | 查看: 19次 | 进入软件测试论坛讨论

领测软件测试网 <head>
<style type="text/css">
.titleStyle{
background-color:#3366cc;color:#ffffff;border-top:1px solid #FFFFFF;font-size:9pt;cursor:hand;
}
.contentStyle{
background-color:#efefef;color:blue;font-size:9pt;
}

a{
color:blue;
}
body{
font-size:9pt;
}
</style>
</head>
<body>
<script language="JavaScript">
<!--
var layerTop=20; //菜单顶边距
var layerLeft=30; //菜单左边距
var layerWidth=140; //菜单总宽
var titleHeight=20; //标题栏高度
var contentHeight=200; //内容区高度
var stepNo=10; //移动步数,数值越大移动越慢

var itemNo=0;runtimes=0;
document.write(@#<span id=itemsLayer style="position:absolute;overflow:hidden;border:1px solid #efefef;left:@#+layerLeft+@#;top:@#+layerTop+@#;width:@#+layerWidth+@#;">@#);

function addItem(itemTitle,itemContent){
itemHTML=@#<div id=item@#+itemNo+@# itemIndex=@#+itemNo+@# style="position:relative;left:0;top:@#+(-contentHeight*itemNo)+@#;width:@#+layerWidth+@#;"><table width=100% cellspacing="0" cellpadding="0">@#+
@#<tr><td height=@#+titleHeight+@# onclick=changeItem(@#+itemNo+@#) class="titleStyle" align=center>@#+itemTitle+@#</td></tr>@#+
@#<tr><td height=@#+contentHeight+@# class="contentStyle">@#+itemContent+@#</td></tr></table></div>@#;
document.write(itemHTML);
itemNo++;
}
//添加菜单标题和内容,可任意多项,注意格式:
addItem(@#欢迎@#,@#<BR>  WWW.CNBRUCE.COM@#);
addItem(@#网页专区@#,@#<center><a href="#">网页工具</a> <BR><BR><a href="#">技术平台</a> <BR><BR><a href="#">设计理念</a> <BR><BR><a href="#">更多</a></center>@#);
addItem(@#美工教室@#,@#<center><a href="#">平面设计 </a> <BR><BR><a href="#">三维空间</a> <BR><BR><a href="#">设计基础</a> <BR><BR><a href="#">更多..</a></center>@#);
addItem(@#Flash@#,@#<center><a href="#">基础教程</a> <BR><BR><a href="#">技巧运用</a> <BR><BR><a href="#">实例剖析</a> <BR><BR><a href="#">更多..</a></center>@#);
addItem(@#多媒体@#,@#<center><a href="#">DIRECTOR</a> <BR><BR><a href="#">Authorware</a> <BR><BR><a href="#">更多..</a></center>@#);
addItem(@#精品赏析@#,@#<center><a href="#">设计精品</a></center>@#);

document.write(@#</span>@#)
document.all.itemsLayer.style.height=itemNo*titleHeight+contentHeight;

toItemIndex=itemNo-1;onItemIndex=itemNo-1;

function changeItem(clickItemIndex){
toItemIndex=clickItemIndex;
if(toItemIndex-onItemIndex>0) moveUp(); else moveDown();
runtimes++;
if(runtimes>=stepNo){
onItemIndex=toItemIndex;
runtimes=0;}
else
setTimeout("changeItem(toItemIndex)",10);
}

function moveUp(){
for(i=onItemIndex+1;i<=toItemIndex;i++)
eval(@#document.all.item@#+i+@#.style.top=parseInt(document.all.item@#+i+@#.style.top)-contentHeight/stepNo;@#);
}

function moveDown(){
for(i=onItemIndex;i>toItemIndex;i--)
eval(@#document.all.item@#+i+@#.style.top=parseInt(document.all.item@#+i+@#.style.top)+contentHeight/stepNo;@#);
}
changeItem(0);
//-->
</script>
</body>

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网