Use components of pop
Last Update:2018-12-06
Source: Internet
Author: User
// JavaScript document
VaR think; If (! Think) Think = {} {} ;
If (! Think. Menu) Think. Menu = {} {} ;
Think. Menu. popmenu = function (pwidth, pheight, pstyle, pxfocus, fyfocus) {} {
This. width = pwidth;
This. Height = pheight;
This. xfocus = 0;
This. yfocus = 0;
This. stylecss = pstyle;
VaR rightmenu = Window. createpopup ();
VaR rightmenubody = rightmenu.doc ument. Body;
VaR rdocument=rightmenubody.doc ument;
Rightmenubody. ID = 'rmenu ';
VaR div_id = 'menucontent ';
VaR rdiv = rdocument. createelement ("Div ");
Rdiv. setattribute ('id', div_id );
RUL = rdocument. createelement ("Ul ");
Rdocument. appendchild (rdiv );
Rdiv. appendchild (RUL );
This. Show = function (inameevent, width, height, csssheet ){
Rightmenubody. innerhtml = "";
If (typeof (inameevent )! = 'Undefined '){
VaR mstring = inameevent;
RUL. innerhtml = "";
Sgroup = mstring. Split ("/");
For (VAR Mt = 0; mt <sgroup. length; MT ++ ){
VaR itemstring = sgroup [MT]. Split ("| ");
This. additem (itemstring [0], itemstring [1]);
} }
If (typeof (pxfocus )! = 'Undefined ') {} {This. xfocus = pxfocus} Else {} {This. xfocus = event. X;} ;
If (typeof (fyfocus )! = 'Undefined ') {} {This. xfocus = fyfocus} Else {} {This. yfocus = event. Y;} ;
If (typeof (width )! = 'Undefined ') {} {This. width = width;} ;
If (typeof (height )! = 'Undefined ') {} {This. Height = height;} ;
If (typeof (csssheet )! = 'Undefined ') {} {Rightmenubody.doc ument. createstylesheet (csssheet );} Else {} {Rightmenubody.doc ument. createstylesheet (this. stylecss)} ;
Rightmenubody. innerhtml = "<Div class = grahicsrightmenu oncontextmenu = 'Return false; '>" + rdiv. innerhtml + "</div>"
Try {} {
Rightmenu. Show (this. xfocus, this. yfocus, this. Width, this. Height, document. Body );
} Catch (ERR) {} {
Alert ('pop. Show call parameter error ');
} }
This. additem = function (itemname, itemevent) {} {
Itemevent = "parent." + itemevent
VaR RLI = rdocument. createelement ("Li ");
// RLI. setattribute ('onclick', itemevent); // block the attribute to display the effect
RLI. innerhtml = "<a onclick = 'javascript : Return "+ itemevent +" ; 'Href = '# null' ondrag = 'Return false;'> "+ itemname +" </a> ";
RUL. appendchild (RLI) }
This. Close = function () {} {
Rightmenu. Hide ()}
} // The Menu class ends.
Function rirefresh () {} {
Sky. Close ();
Location. href = location. href;
}
Function riback () {} {History. Back ();}
Function click (E) {} {
If (document. All) {If (event. Button = 2 | event. Button = 3) {showmenu ();} }}
Document. oncontextmenu = function () {} {Showmenu (); Return false;}
Document. onmousedown = click;
Document. ondrag = function () {} {Return false}