& lta href = " gaokaozuowen.aspx " & gt& ltimg src = " images/it . png " & gt; & lt/a & gt; & ltbr & gt
& lt/div & gt;
& lt script & gt
//Output 99
//document.write (new array (100)). Add ("& ltbr >;; ))
//The variable init_pos is the initial Y coordinate value of the layer, and last_pos is the Y coordinate value of the last layer after the layer is moved. They are equal until the following function is executed.
var init _ pos = last _ pos = olayerx . style . postop
Function xxx() {
//Target coordinates, the specific meaning of which is explained in the last two paragraphs.
var scroll top = document . body . scroll top | | document . document element . scroll top | | 0;
Var target position = scroll top+initial position
var step =(target _ pos-last _ pos)/ 10 | 0
//Move the layer step by step.
oLayerx.style.posTop += step
//Update the value of the variable last_pos. Without this step, it is impossible to produce elastic motion effect.
Last_pos += step
//alert(scroll top);
// 1 Here is 1 millisecond.
}
setInterval(" XXX();" , 1)
& lt/script & gt;