1 < Script Language = " Javascript " >
2 Function close_float_left (){
3 Adlayer1.style. Visibility = " Hidden " ;
4 }
5 Function close_float_right (){
6 Adlayer2.style. Visibility = " Hidden " ;
7 }
8 </ Script >
9 < Script Language = " Javascript " >
10 <! --
11 // More JavaScript from Http://www.smallrain.net
12 Function initecad (){
13 Document. All. adlayer1.style. postop = 130 ;
14 Document. All. adlayer1.style. Visibility = ' Visible '
15 Document. All. adlayer2.style. postop = 130 ;
16 Document. All. adlayer2.style. Visibility = ' Visible '
17 Moveleftlayer ( ' Adlayer1 ' );
18 Moverightlayer ( ' Adlayer2 ' );
19 }
20 Function moveleftlayer (layername ){
21 VaR x = 5 ;
22 Var y = 130 ;
23 VaR diff = (Document. Body. scrolltop + Y - Document. All. adlayer1.style. postop) * . 40 ;
24 Var y = Document. Body. scrolltop + Y - Diff;
25 Eval ( " Document. All. " + Layername + " . Style. postop = parseint (y) " );
26 Eval ( " Document. All. " + Layername + " . Style. posleft = x " );
27 SetTimeout ( " Moveleftlayer ('adlayer1 '); " , 20 );
28 }
29 Function moverightlayer (layername ){
30 VaR x = 5 ;
31 Var y = 130 ;
32 VaR diff = (Document. Body. scrolltop + Y - Document. All. adlayer2.style. postop) * . 40 ;
33 Var y = Document. Body. scrolltop + Y - Diff;
34 Eval ( " Document. All. " + Layername + " . Style. postop = y " );
35 Eval ( " Document. All. " + Layername + " . Style. posright = x " );
36 SetTimeout ( " Moverightlayer ('adlayer2 '); " , 20 );
37 }
38
39 Document. Write ( " <Div id = 'adlayer1' style = 'position: absolute; width: 100px; Height: 300px; Z-index: 1; left: 7px; top: 165px; visibility: visible '> <Table align = 'center' width = '000000' border = 0 cellspacing = 1 cellpadding = 2> <tr> <TD Height = '000000'> "
40 + " <A href = 'ad/gqyl.htm' target = '_ blank'> </A> </TD> </tr> <TD Height = '16'> "
41 + " <Div align = 'center'> <a href = 'javascript: close_float_left (); '> close </a> </div> </TD> </tr> </table> </div> "
42 + " <Div id = 'adlayer2' style = 'position: absolute; width: 100px; Height: 300px; Z-index: 1; Right: 7px; top: 165px; visibility: visible '> <Table align = center width = '000000' border = 0 cellspacing = 1 cellpadding = 2> <tr> <TD Height = '000000'> "
43 + " <A href = 'newspaper/index. aspx 'target = '_ blank'> </a> </TD> </tr> <TD height = '16'> "
44 + " <Div align = 'center'> <a href = 'javascript: close_float_right (); '> close </a> </div> </TD> </tr> </table> </div> " );
45 Initecad ()
46 // -->
47 </ Script >
In this example, adlayer1 is on the left and adlayer2 is on the right. This is actually something that moves the scroll bar and draws the document in a new position.
As for the floating page advertisement, you can use the timeline to get a few key points, just like flash, and then it starts to change on its own.