Html Code As follows: Code
< Div ID = Img1 Style = " Z-INDEX: 100; left: 2px; width: 200px; position: absolute; top: 43px; Height: 100px;
Visibility: visible; " > <A href = " HTTP: // Www.sutt56.com/index.asp "target =" _ blank "> </a> </ div>
< Script SRC = " JS/JS. js " > </ Script >
The javascript code is as follows: Code
VaR xpos = 300 ;
VaR ypos = 200 ;
VaR step = 1 ;
VaR Delay = 20 ;
VaR height = 0 ;
VaR hoffset = 0 ;
VaR woffset = 0 ;
VaR yon = 0 ;
VaR Xon = 0 ;
VaR pause = True ;
VaR interval;
Img1.style. Top = Ypos;
Function changepos ()
{
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;
If (Yon)
{Ypos = Ypos + Step ;}
Else
{Ypos = Ypos - Step ;}
If (Ypos < 0 )
{Yon = 1 ; Ypos = 0 ;}
If (Ypos > = (Height - Hoffset ))
{Yon = 0 ; Ypos = (Height - Hoffset );}
If (Xon)
{Xpos = Xpos + Step ;}
Else
{Xpos = Xpos - Step ;}
If (Xpos < 0 )
{Xon = 1 ; Xpos = 0 ;}
If (Xpos > = (Width - Woffset ))
{Xon = 0 ; Xpos = (Width - Woffset );}
}
Function start ()
{
Img1.visibility = " Visible " ;
Interval = Setinterval ( ' Changepos () ' , Delay );
}
Function pause_resume ()
{
If (Pause)
{
Clearinterval (interval );
Pause = False ;}
Else
{
Interval = Setinterval ( ' Changepos () ' , Delay );
Pause = True ;
}
}
Start ();
Save this file as Js. js under the JS directory
Image Source: