After having this
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
does not work correctly.
The solution to this problem: this is because after adding DOCTYPE declaration, JS can not use document.body, must be changed to Document.documentelement, there is add "px".
Before modification: ... width =document.body.Clientwidth;height =document.body. clientheight; Hoffset = Img1.offsetheight; Woffset = Img1.offsetwidth;img1.style.left = XPos + document.body.scrollleft;img1.style.top = YPos + Document.body.scrollTop, ..... Modified: ... width =
document.documentelement. Clientwidth;height =
document.documentelement. clientheight; Hoffset = Qingrenjie_pd.offsetheight; Woffset = Qingrenjie_pd.offsetwidth;img1.style.left = XPos + document.documentElement.scrollLeft
+ "px"; Img1. Style.top = YPos + document.documentElement.scrollTop
+ "px";