Absolutely wonderful: Making pop-up menus similar to Window right-click on the web page

zhaozj2021-02-11  176

Be a pop-up menu similar to Window right-click.

Download JS files and views directly: http://202.114.98.14/~cityhunter/jscripts/jscripts.htm code is as follows:

VAR OBJ;

Function loadObj (o) {OBJ = O;

Function expand () {var h = parseint (obj.height); var w = parseint (obj.width); var op = 10;

IF (h <= 170) {IF (W <60) Obj.Style.Width = W 6;

Obj.style.height = H 17;

X = setTimeout ('expand ()', 25);} else {obj.style.width = 60; obj.style.Height = 174; cleArtimeout (x);}}

VAR DRAG = 0; VAR MOVE = 0; function dblclick () {if (event.button == 0) {Obj.style.visibility = "visible"; obj.style.left = window.Event.x; obj.style .top = window.event.y; obj.style.width = 0; obj.style.height = 0;

Obj.filters.Item (0) .apply (); obj.filters.Item (0) .Transition = 25; obj.filters (0) .play (0.5);

Expand ();}}

Function mousemove () {if (move == 1) {Obj.Style.cursor = "move"; obj.style.left = window.event.x-l; obj.style.top = window.event.y-t;}}

Function mousedown () {if (drag) {l = window.Event.x - parseint (obj.style.left); t = window.event.y - parseint (obj.style.top); obj.Style.zindex = 1; move = 1;} else {document.body.style.cursor = 'default'; obj.style.visibility = 'hidden';}}

Function mouseestop () {WINDOW.EVENT.RETURNVALUE = FALSE;

Function mouseup () {move = 0; obj.Style.cursor = "hand";

Document.οndblclick = dblclick; document.οnmοusedοwn = mousedown; document.οnmοusemοve = mousemove; Document.οndragStart = mouseestop; document.οnmοuseup = mouseup;

转载请注明原文地址:https://www.9cbs.com/read-5067.html

New Post(0)