<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
< Html Xmlns = "Http://www.w3.org/1999/xhtml" >
< Head >
< Meta HTTP-equiv = "Content-Type" Content = "Text/html; charset = gb2312" />
< Title > Untitled document </ Title >
</ Head >
< Body >
< Script >
VaR X = 20 ; Y = 30 ; // Initial Layer position
VaR I = 0 , J = 0 ; // Direction variable
Function Floatad ()
{
VaR OBJ = Document. getelementbyid ( " Ad2 " );
VaR R = Document. Body. offsetwidth - OBJ. offsetwidth - 24 ; // Page width-Layer Width-right scroll bar width
VaR B = Document. Body. offsetheight - OBJ. offsetheight; // Page height-Layer Width
OBJ. style. Left = X + Document. Body. scrollleft; // Layer left distance + left distance after scrolling
OBJ. style. Top = Y + Document. Body. scrolltop; // Layer-to-top distance + rolling top distance
If (I = 0 ){
X ++ ; If (X = R) {I = 1 ;}
}
Else {
X -- ; If (X = 0 ) {I = 0 ;}
}
If (J = 0 ){
Y ++ ; If (Y = B) {J = 1 ;}
}
Else {
Y -- ; If (Y = 0 ) {J = 0 ;}
}
SetTimeout ( " Floatad () " , 10 )
}
Window. onload = Floatad;
</ Script >
< Div ID = "Ad2" Style = "Position: absolute; width: 200px; Height: 148px; left: 20px; top: 30px; Z-index: 3" > < A Href = "SY /" Target = "_ Blank" >
< IMG SRC = "2.gif" Width = "200" Height = "148" /> </ A > </ Div >
</ Body >
</ Html >