. Center_div2
{
Position: absolute;
Z-index: 1;
Text-align: center;
Display: none;
Background-color: # e0e7ef;
}
. Center_div_tips2
{
Position: relative;
Color: Red;
}
<Div id = "detailDiv" class = "center_div2">
<Span class = "center_div_tips2"> updating data... </span>
</Div>
Copy codeThe Code is as follows:
Function IsIE (){
Var OsObject = "";
If (navigator. userAgent. indexOf ("MSIE")> 0 ){
Return true;
}
}
Function mouseMove (ev ){
/* The event mechanism of ie and ff is different */
Ev = ev | window. event;
Var mousePos = mouseCoords (ev );
Var detailDiv = document. getElementById ("detailDiv"); // The layer to be popped up
DetailDiv. style. left = (mousePos. x + 10) + "px ";
DetailDiv. style. top = (mousePos. y + 18) + "px ";
}
Function mouseCoords (ev ){
If (ev. pageX | ev. pageY ){
Return {
X: ev. pageX,
Y: ev. pageY
};
}
/* The boundary processing of ie and ff is different */
If (IsIE ()){
Return {x: ev. clientX + document.doc umentElement. scrollLeft-document.doc umentElement. clientLeft, y: ev. clientY + document.doc umentElement. scrollTop-document.doc umentElement. clientTop}
}
Else {
Return {x: ev. clientX + document. body. scrollLeft-document. body. clientLeft, y: ev. clientY + document. body. scrollTop-document. body. clientTop}
}
}
Document. onkeydown = keydown;