首页  »  网页设计教程  »  仿Office 2003的工具条

仿Office 2003的工具条

浏览数:共 616 次     评论:共 0 条     发布日期:2012-04-05     分类:javascript

<head>
<meta http-equiv="content-language" content="zh-cn">
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>仿office 2003的工具条</title>
<script>
/*----------
舜子制作
menu javascript made by puterjam
e-mail:puterjam@etang.com
-------------*/
var listnum=0;
var menu_height;
var menu_width;
var menu_left;
var menu_top;
var topmar = 1;
var leftmar = -2;
var space = 1;
var isvisible;

{
this.listname=listname
this.buttonname=buttonname
this.valuename=valuename
}

{
num=obj.id.charat(obj.id.length-1)
if (!scroll) {scroll=0}
if (!tw) {tw=105}
listbox=eval(lb[num].listname)
listbutton=eval(lb[num].buttonname)
listvalue=eval(lb[num].valuename)
switch (action)
{
case 0:
listbox.classname="getlist";listbutton.classname="listover"
break;
case 1:
if (listbox.gf=="0")
{listbox.classname="lostlist";listbutton.classname="menubar"}
break;
case 2:
for (i=0;i<lb.length;i++)
{
if (num!=i.tostring()){
nlistbox=eval(lb[i].listname)
nlistbutton=eval(lb[i].buttonname)
nlistvalue=eval(lb[i].valuename)
nlistbox.classname="lostlist";nlistbutton.classname="menubar"
nlistbox.gf="0"
}
}
showmenu(listbox,showlist,tw,scroll);listbox.classname="getlist";listbox.gf="1"
listnum=num;
break;
}
}

{
var mx;
var my;
var vdiv;
var mdiv;
if (isvisible == true)
{
vdiv = document.all("listdiv");
mx = window.event.clientx + document.body.scrollleft;
my = window.event.clienty + document.body.scrolltop;
if ((mx < parseint(vdiv.style.left)) || (mx > parseint(vdiv.style.left)+vdiv.offsetwidth) ||
(my < parseint(vdiv.style.top)-menu_height) || (my > parseint(vdiv.style.top)+vdiv.off


setheight)) {
vdiv.style.visibility = "hidden";
isvisible = false;
}
}

if (isvisible==false)
{
for (i=0;i<lb.length;i++)
{
listbox=eval(lb[i].listname)
listbutton=eval(lb[i].buttonname)
listvalue=eval(lb[i].valuename)
listbox.classname="lostlist";listbutton.classname="menubar"
listbox.gf="0"
}
}
}

vmnucode = "<table id="submenu" cellspacing=0 cellpadding=0 bgcolor=#ffffff border=0 style="width:"+twidth +
";border-collapse: collapse" class="listdiv"><tr height=23><td nowrap align=left>" +
vmnucode + "</td></tr></table>";

menu_width = obj.offsetwidth;
menu_left = obj.offsetleft + leftmar+2;
menu_top = obj.offsettop + topmar + menu_height + space-3;
vparent = obj.offsetparent;
while (vparent.tagname.touppercase() != "body")
{
menu_left += vparent.offsetleft;
menu_top += vparent.offsettop;
vparent = vparent.offsetparent;
}

listdiv.style.top = menu_top;
listdiv.style.left = menu_left;

else {listdiv.style.overflow="scroll";listdiv.style.width=twidth+18}
listdiv.style.visibility = "visible";
var cssopaction=submenu.filters[0].opacity
submenu.filters[0].opacity=0;
submenu.filters[1].apply();
&nbs



上一篇:60秒倒计时的1个小JS
下一篇:JS加密解密终级指南