网页仿 Office 2003 的工具条

摘要:
charset=gb2312“>listbox.className=“getlist”;for(i=0;i<滚动);listbox.className=”getlist“;parseInt(vDiv.style.left))||(mX>i&llt;

网页仿 Office 2003 的工具条   [ 日期:2005-01-27 ]   [ 来自:网上摘录 ]<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>仿Office 2003的工具条</title>
<script>
 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;

function listbox(listname,buttonname,valuename)
{
this.listname=listname
this.buttonname=buttonname
this.valuename=valuename
}

function listaction(obj,action,showlist,scroll,tw)
{
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;
  }
}

function HideMenu()
{
 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.offsetHeight))  {
   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"
 }
 }
}

function ShowMenu(obj,vMnuCode,tWidth,scroll) {
 vMnuCode = "<table cellspacing=0 cellpadding=0 bgcolor=#ffffff border=0 style='"+tWidth +
      ";border-collapse: collapse' class='listDiv'><tr height=23><td nowrap align=left>" +
       vMnuCode + "</td></tr></table>";

 menu_height = obj.offsetHeight;
 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.innerHTML = vMnuCode;
 listDiv.style.top = menu_top;
 listDiv.style.left = menu_left;

 if (scroll==0) {listDiv.style.overflow="visible";listDiv.style.width=tWidth}
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();
    submenu.filters[0].opacity=100;
    submenu.filters[1].Play();

     
 isvisible = true;
}

function menuitem(lightcolor,normalcolor,icon,title,url)
{
this.lightcolor=lightcolor
this.normalcolor=normalcolor
this.icon=icon
this.title=title
this.url=url
}

function bulidmenu(arrayname)
{
var menuarray=eval(arrayname)
menucontent='<table border="0" width="100%">'
for (i=0;i<menuarray.length;i++)
{
if (menuarray[i].title!="_line")
{
if (menuarray[i].url!="_disable"){css="getitem"}else{css="lostitem"}
if (menuarray[i].icon.length==0)
{
content='<table cellspacing="0" cellpadding="0"><tr><td class="'+css+'">'+menuarray[i].title+'</td></tr></table>'
}
else
{
content='<table cellspacing="0" cellpadding="0"><tr><td nowrap><img src="http://t.zoukankan.com/MaxIE-p-302603.html'+menuarray[i].icon+'"></td><td class="'+css+'">'+menuarray[i].title+'</td></tr></table>'
}

if (menuarray[i].url!="_disable"){
menucontent=menucontent+'<tr><td height=16 onmouseover="style.backgroundColor=\''+ menuarray[i].lightcolor+'\'" onmouseout="style.backgroundColor=\''+ menuarray[i].normalcolor+'\'" onclick="Golist(\''+menuarray[i].title+'\')">'+content+'</td></tr>'
}
else
{
menucontent=menucontent+'<tr><td height=16 style="fitler:gray">'+content+'</td></tr>'
}

}
else
{
menucontent=menucontent+'<tr><td height=4><img src="http://t.zoukankan.com/images/dock.gif" height=1></td></tr>'
}


}
menucontent=menucontent+"</table>"
return menucontent
}

 function HL_Menu(obj,state)
{
switch (state)
{
case 0:
 obj.className="menuover"
 break;
case 1:
 obj.className="menuup"
 break;
}
 }
 
var lb=new Array()
lb[0]=new listbox('listbox0','listbutton0','listvalue0')
lb[1]=new listbox('listbox1','listbutton1','listvalue1')
 
var list1=new Array()
list1[0]=new menuitem("#B1CBE4","","","ListItem1","")
list1[1]=new menuitem("#B1CBE4","","","ListItem2","")
list1[2]=new menuitem("#B1CBE4","","","ListItem3","")
list1[3]=new menuitem("#B1CBE4","","","ListItem4","")
list1[4]=new menuitem("#B1CBE4","","","ListItem5","")
list1[5]=new menuitem("#B1CBE4","","","ListItem6","")
list1[6]=new menuitem("#B1CBE4","","","ListItem7","")
list1[7]=new menuitem("#B1CBE4","","","ListItem8","")
list1[8]=new menuitem("#B1CBE4","","","ListItem9","")
list1[9]=new menuitem("#B1CBE4","","","ListItem10","")

blist1=bulidmenu("list1")


var list2=new Array()
list2[0]=new menuitem("#B1CBE4","","","字体1","")
list2[1]=new menuitem("#B1CBE4","","","字体2","")
list2[2]=new menuitem("#B1CBE4","","","字体3","")
list2[3]=new menuitem("#B1CBE4","","","字体4","")
list2[4]=new menuitem("#B1CBE4","","","字体5","")
list2[5]=new menuitem("#B1CBE4","","","字体6","")
list2[6]=new menuitem("#B1CBE4","","","字体7","")
list2[7]=new menuitem("#B1CBE4","","","字体8","")
list2[8]=new menuitem("#B1CBE4","","","字体9","")
list2[9]=new menuitem("#B1CBE4","","","字体10","")

blist2=bulidmenu("list2")
function Golist(text)
{
listvalue=eval(lb[listnum].valuename)
listvalue.innerText=text
vDiv = document.all("listDiv");
vDiv.style.visibility = "hidden";
isvisible = false;
}
</script>

<style>
.lostfocus { border: 1px #ffffff solid; background-color: #ffffff; font-size: 12px; font-family: Arial; }
.getfocus { border: 1px #08246B solid;background-color: #ffffff; font-family: Arial; font-size: 12px; }

.menubar {filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=0, startcolorstr=#F7F7F7, endcolorstr=#DEDBD6)}
.bodybar {filter:progid:DXImageTransform.Microsoft.Gradient(gradienttype=1, endcolorstr=#F7F7F7, startcolorstr=#DEDBD6)}
.leftitem { font-family: Arial; font-size: 12px; color: #000000; cursor: hand }
.getitem { font-family: Arial; font-size: 12px; color: #000000; cursor: default }
.lostitem { cursor: default; color: #808080; font-size: 12px; font-family: Arial; }
.menuup { PADDING-LEFT: 4px; PADDING-RIGHT: 4px; CURSOR: hand;}
.menuover { PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BACKGROUND-COLOR: #B5BED6; BORDER: 1px solid #08246B; CURSOR: hand; }
.lostlist { border: 1px #ffffff solid; background-color: #ffffff; font-size: 12px; font-family: Arial; }
.getlist  { border: 1px #08246B solid;background-color: #ffffff; font-family: Arial; font-size: 12px; }

.listover {BACKGROUND-COLOR: #B5BED6; BORDER-left:1px solid #08246B}
.listDiv { filter: alpha(opacity=90,finishopacity=0,style=0) blendtrans(duration=.3); }

</style>
</head>

<body onclick="HideMenu()" bgcolor="999999">
<div id=listDiv style='border:1px #636563 solid;VISIBILITY: hidden;POSITION: absolute;overflow:scroll;height:150'></div>
<table border="0" cellspacing="0" cellpadding="0">
 <tr>
  <td>
<table border="0" cellspacing="0" cellpadding="0" height="30">
 <tr>
  <td><table border="0" cellspacing="0" cellpadding="0" height="22">
   <tr>
       <td width="5"></td>
    <td nowrap onmouseover="HL_Menu(this,0)" onmouseout="HL_Menu(this,1)" class="menuup">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td class="leftitem">文件(F)</td></tr></table>
    </td>
    <td width="5"></td>
    <td nowrap onmouseover="HL_Menu(this,0)" onmouseout="HL_Menu(this,1)" class="menuup">
    <table border="0" cellspacing="0" cellpadding="0"><tr><td class="leftitem">编辑(E)</td></tr></table>
    </td>
   </tr>
  </table></td>
 </tr>
</table>
  </td>
 </tr>
 <tr>
  <td>
<table border="1" cellspacing="0" cellpadding="4" bgcolor="#F7F7F7"  style="border-collapse: collapse">
 <tr>
  <td class="menubar">
   <table border="0" cellspacing="0" cellpadding="0">
    <tr>
       <td nowrap>
     <table border="0" cellspacing="0" cellpadding="1" id="table30">
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   </table></td>
     <td nowrap><font size="2">姓名</font></td>
     <td nowrap>
   <input type="text" name="T5" size="18" gf="0" onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' onblur='this.className="lostfocus";this.gf="0"' onfocus='this.className="getfocus";this.gf="1"'></td>
     <td nowrap><font size="2">密码</font></td>
     <td nowrap>
   <input type="password" name="T6" size="18" gf="0" onmouseover='this.className="getfocus"' onmouseout='if (this.gf=="0") this.className="lostfocus"' onblur='this.className="lostfocus";this.gf="0"' onfocus='this.className="getfocus";this.gf="1"'></td>
     <td nowrap><img height=14 width=0></td>
     <td nowrap onmouseover="HL_Menu(this,0)" onmouseout="HL_Menu(this,1)" class="menuup">
    <table cellspacing="0" cellpadding="0" width="25"><tr><td nowrap></td><td class="leftitem">
     登陆</td></tr></table>
    </td>
     <td nowrap> </td>
    </tr>
   </table>
  </td>
 </tr>
</table>

  </td>
 </tr>
 <tr>
  <td>

<table border="1" cellspacing="0" cellpadding="4" bgcolor="#F7F7F7"  style="border-collapse: collapse">
 <tr>
  <td class="menubar">
   <table border="0" cellspacing="0" cellpadding="0">
    <tr>
       <td nowrap>
     <table border="0" cellspacing="0" cellpadding="1" id="table34">
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   <tr>
    <td><img height=1 width=1></td>
   </tr>
   </table></td>
     <td nowrap>
   <div gf="0" onmouseover='listaction(this,0)' onmouseout='listaction(this,1)' onclick='listaction(this,2,blist1,0)' style="cursor:default">
   <table border="0" cellpadding="0" cellspacing="0" id="table35">
 <tr>
  <td valign=center style="text-indent:4px"><font size="2" face="Verdana">
  <span id=listvalue0>
   &nbsp;</span></font></td>
  <td width=12 id="listbutton0">
 <table border="0" cellpadding="0" id="table36">
  <tr height=1>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
  </tr>
  <tr height=1>
   <td></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td></td>
  </tr>
  <tr height=1>
   <td></td>
   <td></td>
   <td bgcolor="#000000"></td>
   <td></td>
   <td></td>
  </tr>
 </table></td>
 </tr>
 </table>
  
   </div></td>
     <td nowrap>
   <div gf="0" onmouseover='listaction(this,0)' onmouseout='listaction(this,1)' onclick='listaction(this,2,blist2,1,100)' style="cursor:default">
   <table border="0" cellpadding="0" cellspacing="0" id="table37">
 <tr>
  <td valign=center style="text-indent:4px"><font size="2" face="Verdana"><span id=listvalue1>
   &nbsp;</span></font></td>
  <td width=12 id="listbutton1">
 <table border="0" cellpadding="0" id="table38">
  <tr height=1>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
  </tr>
  <tr height=1>
   <td></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td bgcolor="#000000"></td>
   <td></td>
  </tr>
  <tr height=1>
   <td></td>
   <td></td>
   <td bgcolor="#000000"></td>
   <td></td>
   <td></td>
  </tr>
 </table></td>
 </tr>
 </table>
  
   </div></td>
     <td nowrap>
    </td>
     <td nowrap><img height=14 width=0></td>
     <td nowrap onmouseover="HL_Menu(this,0)" onmouseout="HL_Menu(this,1)" class="menuup">
    <table cellspacing="0" cellpadding="0" width="16"><tr><td nowrap></td><td align=center>
     <b>B</b></td></tr></table>
    </td>
         <td nowrap onmouseover="HL_Menu(this,0)" onmouseout="HL_Menu(this,1)" class="menuup">
    <table cellspacing="0" cellpadding="0" width="16"><tr><td nowrap></td><td align=center>
     <i>
     <b>I</b></i></td></tr></table>
    </td>
    <td nowrap onmouseover="HL_Menu(this,0)" onmouseout="HL_Menu(this,1)" class="menuup">
    <table cellspacing="0" cellpadding="0" width="16"><tr><td nowrap></td><td align=center>
     <u>
     <b>U</b></u></td></tr></table>
    </td>
     <td nowrap> </td>
    </tr>
   </table>
  </td>
 </tr>
</table>
  </td>
 </tr>
</table>
</body>
</html>

免责声明:文章转载自《网页仿 Office 2003 的工具条》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇android 编译libjpegWebpack 解析ES6和React下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

nginx+tomcat+java部署总结

昨天部署了一下nginx+tomcat+java出现了很多问题,以下为整理总结。 使用了两种部署方式,一种是源码部署,一种是war部署。 java源码部署总结: 环境:nginx+tomcat 部署方式:源码部署 1 源码目录/chroot2/test/schedule 目录下面就是所有源码了 2 tomcat 位置: /usr/local/tomc...

命令行创建快捷方式的批处理脚本

    从网上搜集了一些“创建快捷方式”的批处理脚本,以供将来工作中参考: 一、示例为创建记事本的快捷方式到桌面 set path=%WINDIR%\notepad.exe set topath="%USERPROFILE%\桌面\记事本.url" echo [InternetShortcut] >> %topath% echo URL="%p...

React组件中对子组件children进行加强

React组件中对子组件children进行加强 问题 如何对组件的children进行加强,如:添加属性、绑定事件,而不是使用<div>{this.props.children}</div>在<div>上进行处理。 前车之鉴 今天写组件遇到这个问题,在网上查阅了很多资料,都说可以使用React.cloneElement...

gulp打包

https://blog.csdn.net/j_bleach/article/details/53047467 https://www.cnblogs.com/flyingzeng/p/10536690.html https://zhuanlan.zhihu.com/p/162049537 https://www.npmjs.com/package/gul...

对List中每个对象元素按时间顺序排序

1 import java.util.*; 2 3 public class ListSort { 4 public static class UserBean { 5 private String id; 6 private String birthday; 7...

11.ThinkPHP分页

分页实现 ThinkPHP5.1内置了分页实现,要给数据添加分页输出功能变得非常简单,可以直接在Db类查询的时候调用paginate方法: 官方Demo // 查询状态为1的用户数据 并且每页显示10条数据 $list = Db::name('user')->where('status',1)->paginate(10); // 把分页数据赋值...