Copy codeThe Code is as follows:
<SCRIPT language = JavaScript>
<! --
Window. onload = getMsg;
Window. onresize = resizeDiv;
Window. onerror = function (){}
// SMS prompt
Var divTop, divLeft, divWidth, divHeight, docHeight, docWidth, objTimer, I = 0;
Function getMsg ()
{
Try {
DivTop = parseInt (document. getElementById ("eMeng"). style. top, 10)
DivLeft = parseInt (document. getElementById ("eMeng"). style. left, 10)
DivHeight = parseInt (document. getElementById ("eMeng"). offsetHeight, 10)
DivWidth = parseInt (document. getElementById ("eMeng"). offsetWidth, 10)
DocWidth = document. body. clientWidth;
DocHeight = document. body. clientHeight;
Document. getElementById ("eMeng"). style. top = parseInt (document. body. scrollTop, 10) + docHeight + 10; // divHeight
Document. getElementById ("eMeng"). style. left = parseInt (document. body. scrollLeft, 10) + docWidth-divWidth
Document. getElementById ("eMeng"). style. visibility = "visible"
ObjTimer = window. setInterval ("moveDiv ()", 10)
}
Catch (e ){}
}
Function resizeDiv ()
{
I + = 1
If (I> 600) closeDiv () // if the customer wants to disable it automatically, the user will disable it.
Try {
DivHeight = parseInt (document. getElementById ("eMeng"). offsetHeight, 10)
DivWidth = parseInt (document. getElementById ("eMeng"). offsetWidth, 10)
DocWidth = document. body. clientWidth;
DocHeight = document. body. clientHeight;
Document. getElementById ("eMeng"). style. top = docHeight-divHeight + parseInt (document. body. scrollTop, 10)
Document. getElementById ("eMeng"). style. left = docWidth-divWidth + parseInt (document. body. scrollLeft, 10)
}
Catch (e ){}
}
Function moveDiv ()
{
Try
{
If (parseInt (document. getElementById ("eMeng"). style. top, 10) <= (docHeight-divHeight + parseInt (document. body. scrollTop, 10 )))
{
Window. clearInterval (objTimer)
ObjTimer = window. setInterval ("resizeDiv ()", 1)
}
DivTop = parseInt (document. getElementById ("eMeng"). style. top, 10)
Document. getElementById ("eMeng"). style. top = divTop-1
}
Catch (e ){}
}
Function closeDiv ()
{
Document. getElementById ('emeng'). style. visibility = 'den den ';
If (objTimer) window. clearInterval (objTimer)
}
-->
</SCRIPT>