1 <style type="text/css">
2
3 body {font-size: 9pt;}
4 table {font-size: 9pt; cursor: default; margin: 0;}
5 tr {height: 20;}
6 tr.over {font-size: 9pt; color: #000000; background-color: #66aadd; cursor: default;}
7 tr.out {font-size: 9pt; color: #000000; background-color: #CCCCCC; cursor: default;}
8 div.rm_div {position: absolute; filter: Alpha(Opacity='95'); display: none; border: 2px outset #CCCCCC; background-color: #CCCCCC; width: 0; height: 0;}
9 hr.sperator {border: 1px inset #CCCCCC;}
10
11 </style>
12
13 <meta name="Microsoft Theme" content="none"></head>
14
15 <body background="" oncontextmenu="self.event.returnValue=false" link="#CCCCCC" vlink="#CCCCCC" alink="#CCCCCC">
16
17 <script language="JScript">
18 <!--
19 function RightMenu()
20 {
21 this.AddExtendMenu=AddExtendMenu;
22 this.AddItem=AddItem;
23 this.GetMenu=GetMenu;
24 this.HideAll=HideAll;
25 this.I_OnMouseOver=I_OnMouseOver;
26 this.I_OnMouseOut=I_OnMouseOut;
27 this.I_OnMouseUp=I_OnMouseUp;
28 this.P_OnMouseOver=P_OnMouseOver;
29 this.P_OnMouseOut=P_OnMouseOut;
30 A_rbpm = new Array();
31 HTMLstr = "";
32 HTMLstr += "<!-- RightButton PopMenu -->\n";
33 HTMLstr += "\n";
34 HTMLstr += "<!-- PopMenu Starts -->\n";
35 HTMLstr += "<div id='E_rbpm' class='rm_div'>\n";
36 // rbpm = right button pop menu
37 HTMLstr += "<table width='100%' border='0' cellspacing='0'>\n";
38 HTMLstr += "<!-- Insert A Extend Menu or Item On Here For E_rbpm -->\n";
39 HTMLstr += "</table>\n";
40 HTMLstr += "</div>\n";
41 HTMLstr += "<!-- Insert A Extend_Menu Area on Here For E_rbpm -->";
42 HTMLstr += "\n";
43 HTMLstr += "<!-- PopMenu Ends -->\n";
44 }
45 function AddExtendMenu(id,name,parent)
46 {
47 var TempStr = "";
48 if(HTMLstr.indexOf("<!-- Extend Menu Area : E_"+id+" -->") != -1)
49 {
50 alert("E_"+id+"already exist!");
51 return;
52 }
53 eval("A_"+parent+".length++");
54 eval("A_"+parent+"[A_"+parent+".length-1] = id"); // 将此项注册到父菜单项的ID数组中去
55 TempStr += "<!-- Extend Menu Area : E_"+id+" -->\n";
56 TempStr += "<div id='E_"+id+"' class='rm_div'>\n";
57 TempStr += "<table width='100%' border='0' cellspacing='0'>\n";
58 TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+id+" -->";
59 TempStr += "</table>\n";
60 TempStr += "</div>\n";
61 TempStr += "<!-- Insert A Extend_Menu Area on Here For E_"+id+" -->";
62 TempStr += "<!-- Insert A Extend_Menu Area on Here For E_"+parent+" -->";
63 HTMLstr = HTMLstr.replace("<!-- Insert A Extend_Menu Area on Here For E_"+parent+" -->",TempStr);
64
65
66 eval("A_"+id+" = new Array()");
67 TempStr = "";
68 TempStr += "<!-- Extend Item : P_"+id+" -->\n";
69 TempStr += "<tr id='P_"+id+"' class='out'";
70 TempStr += " onmouseover='P_OnMouseOver(\""+id+"\",\""+parent+"\")'";
71 TempStr += " onmouseout='P_OnMouseOut(\""+id+"\",\""+parent+"\")'";
72 TempStr += " onmouseup=window.event.cancelBubble=true;";
73 TempStr += " onclick=window.event.cancelBubble=true;";
74 TempStr += "><td nowrap>";
75 TempStr += " "+name+" </td><td style='font-family: webdings; text-align: right;'>4";
76 TempStr += "</td></tr>\n";
77 TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->";
78 HTMLstr = HTMLstr.replace("<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->",TempStr);
79 }
80 function AddItem(id,name,parent,location)
81 {
82 var TempStr = "";
83 var ItemStr = "<!-- ITEM : I_"+id+" -->";
84 if(id == "sperator")
85 {
86 TempStr += ItemStr+"\n";
87 TempStr += "<tr style='height: 3;' class='out' onclick='window.event.cancelBubble=true;' onmouseup='window.event.cancelBubble=true;'><td colspan='2'><hr class='sperator'></td></tr>";
88 TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->";
89 HTMLstr = HTMLstr.replace("<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->",TempStr);
90 return;
91 }
92 if(HTMLstr.indexOf(ItemStr) != -1)
93 {
94 alert("I_"+id+"already exist!");
95 return;
96 }
97 TempStr += ItemStr+"\n";
98 TempStr += "<tr id='I_"+id+"' class='out'";
99 TempStr += " onmouseover='I_OnMouseOver(\""+id+"\",\""+parent+"\")'";
100 TempStr += " onmouseout='I_OnMouseOut(\""+id+"\")'";
101 TempStr += " onclick='window.event.cancelBubble=true;'";
102 if(location == null)
103 TempStr += " onmouseup='I_OnMouseUp(\""+id+"\",\""+parent+"\",null)'";
104 else
105 TempStr += " onmouseup='I_OnMouseUp(\""+id+"\",\""+parent+"\",\""+location+"\")'";
106 TempStr += "><td nowrap>";
107 TempStr += " "+name+" ";
108 TempStr += "</td><td></td></tr>\n";
109 TempStr += "<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->";
110 HTMLstr = HTMLstr.replace("<!-- Insert A Extend Menu or Item On Here For E_"+parent+" -->",TempStr);
111 }
112 function GetMenu()
113 {
114 return HTMLstr;
115 }
116 function I_OnMouseOver(id,parent)
117 {
118 var Item;
119 if(parent != "rbpm")
120 {
121 var ParentItem;
122 ParentItem = eval("P_"+parent);
123 ParentItem.className="over";
124 }
125 Item = eval("I_"+id);
126 Item.className="over";
127 HideAll(parent,1);
128 }
129 function I_OnMouseOut(id)
130 {
131 var Item;
132 Item = eval("I_"+id);
133 Item.className="out";
134 }
135 function I_OnMouseUp(id,parent,location)
136 {
137 var ParentMenu;
138 window.event.cancelBubble=true;
139 OnClick();
140 ParentMenu = eval("E_"+parent);
141 ParentMenu.display="none";
142 if(location == null)
143 eval("Do_"+id+"()");
144 else
145 window.open(location);
146 }
147 function P_OnMouseOver(id,parent)
148 {
149 var Item;
150 var Extend;
151 var Parent;
152 if(parent != "rbpm")
153 {
154 var ParentItem;
155 ParentItem = eval("P_"+parent);
156 ParentItem.className="over";
157 }
158 HideAll(parent,1);
159 Item = eval("P_"+id);
160 Extend = eval("E_"+id);
161 Parent = eval("E_"+parent);
162 Item.className="over";
163 Extend.style.display="block";
164 Extend.style.posLeft=document.body.scrollLeft+Parent.offsetLeft+Parent.offsetWidth-4;
165 if(Extend.style.posLeft+Extend.offsetWidth > document.body.scrollLeft+document.body.clientWidth)
166 Extend.style.posLeft=Extend.style.posLeft-Parent.offsetWidth-Extend.offsetWidth+8;
167 if(Extend.style.posLeft < 0) Extend.style.posLeft=document.body.scrollLeft+Parent.offsetLeft+Parent.offsetWidth;
168 Extend.style.posTop=Parent.offsetTop+Item.offsetTop;
169 if(Extend.style.posTop+Extend.offsetHeight > document.body.scrollTop+document.body.clientHeight)
170 Extend.style.posTop=document.body.scrollTop+document.body.clientHeight-Extend.offsetHeight;
171 if(Extend.style.posTop < 0) Extend.style.posTop=0;
172 }
173 function P_OnMouseOut(id,parent)
174 {
175 }
176 function HideAll(id,flag)
177 {
178 var Area;
179 var Temp;
180 var i;
181 if(!flag)
182 {
183 Temp = eval("E_"+id);
184 Temp.style.display="none";
185 }
186 Area = eval("A_"+id);
187 if(Area.length)
188 {
189 for(i=0; i < Area.length; i++)
190 {
191 HideAll(Area[i],0);
192 Temp = eval("E_"+Area[i]);
193 Temp.style.display="none";
194 Temp = eval("P_"+Area[i]);
195 Temp.className="out";
196 }
197 }
198 }
199
200 document.onmouseup=OnMouseUp;
201 document.onclick=OnClick;
202 function OnMouseUp()
203 {
204 if(window.event.button == 2)
205 {
206 var PopMenu;
207 PopMenu = eval("E_rbpm");
208 HideAll("rbpm",0);
209 PopMenu.style.display="block";
210 PopMenu.style.posLeft=document.body.scrollLeft+window.event.clientX;
211 PopMenu.style.posTop=document.body.scrollTop+window.event.clientY;
212 if(PopMenu.style.posLeft+PopMenu.offsetWidth > document.body.scrollLeft+document.body.clientWidth)
213 PopMenu.style.posLeft=document.body.scrollLeft+document.body.clientWidth-PopMenu.offsetWidth;
214 if(PopMenu.style.posLeft < 0) PopMenu.style.posLeft=0;
215 if(PopMenu.style.posTop+PopMenu.offsetHeight > document.body.scrollTop+document.body.clientHeight)
216 PopMenu.style.posTop=document.body.scrollTop+document.body.clientHeight-PopMenu.offsetHeight;
217 if(PopMenu.style.posTop < 0) PopMenu.style.posTop=0;
218 }
219 }
220 function OnClick()
221 {
222 HideAll("rbpm",0);
223 }
224 // Add Your Function on following
225 function Do_viewcode(){window.location="view-source:"+window.location.href;}
226 function Do_help(){window.showHelp(window.location);}
227 function Do_exit() {window.close();}
228 function Do_refresh() {window.location.reload();}
229 function Do_back() {history.back();}
230 function Do_forward() {history.forward();}
231 function Do_author(){alert("刘江锋")}
232 -->
233 </script>
234 <script language="JScript">
235 <!--
236 var menu = new RightMenu();
237 menu.AddItem("location"," 打开 ","rbpm");
238 menu.AddItem("leave"," 新窗口打开","rbpm");
239 menu.AddItem("viewcode"," 回复发件人 ","rbpm",null);
240 menu.AddItem("refresh"," 转发","rbpm",null);
241 menu.AddItem("sperator","","rbpm",null);
242 menu.AddItem("help"," 删除到回收站 ","rbpm",null);
243 menu.AddItem("sperator","","rbpm",null);
244 menu.AddItem("author"," 彻底删除","rbpm",null);
245 document.writeln(menu.GetMenu());
246 //snwcwt.innerText=menu.GetMenu();
247 -->
248 </script>
249
posted on 2006-09-05 17:08
闵毓 阅读(601)
评论(0) 编辑 收藏 所属分类:
其他