< Script Type = " Text/JavaScript " >
// <Input id = "XY"/> <input id = "xy2"/>
// Setsizebydrop ('webchart1 ');
Document. onmousemove = This_mousemove;
VaR Oldcss = "" ;
Function Setsizebydrop (ID)
{
VaR OBJ = Document. getelementbyid (ID );
// VaR DIV = Document. createelement ('<Div id = "Div' + ID + '"> </div> ');
// OBJ. parentnode. insertbefore (DIV); Div. insertbefore (OBJ );
// Div. style. Height = obj. offsetheight; Div. style. width = obj. offsetwidth;
OBJ. classname = ' Vframe ' ;
}
// Move mouse event
Function This_mousemove (E) {
VaRE, OBJ;
OBJ=Document. getelementbyid ('Webchart1');
E=Window. Event?Window. Event: E;
Setdivframestyle (E, OBJ, oldcss );
}
// Set object border and cursor Style
Function Setdivframestyle (E1, obj1, oldcss)
{
VaR B = Setcursorstyle (E1, obj1 );
If (B)
{
Oldcss=Obj1.classname;
Obj1.classname= 'Vframe';
}
Else
{
Obj1.classname=Oldcss;
}
}
// Set the cursor Style
Function Setcursorstyle (E2, obj2)
{
Obj2 = Document. getelementbyid ( ' Webchart1 ' );
VaR X, Y, R, B, I, ISL, ISR, ist, ISB;
X = E2.clientx; y = E2.clienty; I = 10 ;
R = Obj2.offsetleft + Obj2.offsetwidth; B = Obj2.offsettop + Obj2.offsetheight;
Ist = Similar (Y, obj2.offsettop, I );
ISB = Similar (Y, B, I );
Isl = Similar (x, obj2.offsetleft, I );
ISR = Similar (x, R, I );
// $ ('Xy2'). value = obj2.offsetleft + "| Upper" + obj2.offsettop + "| right" + R + "| Lower" + B;
// $ ('Xy'). value = x + ":" + Y + obj2.classname;
If (Isl && IST) {Obj2.style. cursor= "NW-resize";Return True;} // Upper left
If (Isl && ISB) {Obj2.style. cursor= "Sw-resize";Return True;}
If (ISR && IST) {Obj2.style. cursor= "Ne-resize";Return True;} // Upper right
If (ISR && ISB) {Obj2.style. cursor= "Se-resize";Return True;}
If (ISL) {Obj2.style. cursor= "E-resize";Return True;} // Left
If (ISR) {Obj2.style. cursor= "E-resize";Return True;} // Right
If (IST) {Obj2.style. cursor= "S-resize";Return True;} // Upper
If (ISB) {Obj2.style. cursor= "S-resize";Return True;} // Lower
Obj2.style. cursor = "" ;
Return False ;
}
// Compare whether the difference between N1 and N2 is within the range of fuzzy I
Function Similar (N1, N2, I)
{
If(Math. Abs (N1-N2)<=I)Return True;
Else Return False;
}
< / SCRIPT>
When you move the cursor over the image border and make the DIV outside the image show the red border, it cannot be displayed. Who can see why? There are other things at hand. Let's look back.