Finally, we provide the appropriate code:
Core code:
Copy codeThe Code is as follows: lastScrollY = 0;
Function heartBeat (){
Var diffY;
If (document.doc umentElement & document.doc umentElement. scrollTop)
DiffY = document.doc umentElement. scrollTop;
Else if (document. body)
DiffY = document. body. scrollTop
Else
{/* Netscape stuff */}
// Alert (diffY );
Percent =. 1 * (diffY-lastScrollY );
If (percent> 0) percent = Math. ceil (percent );
Else percent = Math. floor (percent );
Document. getElementById ("leftDIV"). style. top = parseInt (document. getElementById ("leftDIV"). style. top) + percent + "px ";
Document. getElementById ("rightDIV"). style. top = parseInt (document. getElementById ("leftDIV"). style. top) + percent + "px ";
LastScrollY = lastScrollY + percent;
// Alert (lastScrollY );
}
Sidebar1 = "<div id = leftDIV style = 'left: 0px; PosITION: absolute; TOP: 0px; '> <embed src00002010l.swf width = 150 height = 400 quality = high pluginspage = http://www.macromedia.com/go/getflashplayer type = application/x-shockwave-flash scale = exactfit wmode = transparent id = eccooglad> </embed> </div>"
Sidebar2 = "<div id = rightDIV style = 'right: 0px; PosITION: absolute; TOP: 0px; '> <embed src00002010r.swf width = 150 height = 400 quality = high pluginspage = http://www.macromedia.com/go/getflashplayer type = application/x-shockwave-flash scale = exactfit wmode = transparent id = eccooglad> </embed> </div>"
Document. write (sidebar1 );
Document. write (sidebar2 );
// After the following paragraph is deleted, the couplet will not move along with the screen.
Window. setInterval ("heartBeat ()", 1 );
// -->
Function closeAD ()
{
Document. getElementById ("leftDIV"). style. display = 'none ';
Document. getElementById ("rightDIV"). style. display = 'none ';
}
To prevent conflicts, we modified the Code:
Because the customer only needs the code on the right, we leave it blank on the left.Copy codeThe Code is as follows: lastScrollY = 0;
Function heartBeat2 (){
Var diffY;
If (document.doc umentElement & document.doc umentElement. scrollTop)
DiffY = document.doc umentElement. scrollTop;
Else if (document. body)
DiffY = document. body. scrollTop
Else
{/* Netscape stuff */}
// Alert (diffY );
Percent =. 1 * (diffY-lastScrollY );
If (percent> 0) percent = Math. ceil (percent );
Else percent = Math. floor (percent );
Document. getElementById ("leftDIV2"). style. top = parseInt (document. getElementById ("leftDIV2"). style. top) + percent + "px ";
Document. getElementById ("rightDIV2"). style. top = parseInt (document. getElementById ("leftDIV2"). style. top) + percent + "px ";
LastScrollY = lastScrollY + percent;
// Alert (lastScrollY );
}
Sidebar1 = "<div id = leftDIV2 style = 'left: 0px; PosITION: absolute; TOP: 0px; '> </div>"
Sidebar2 = "<div id = rightDIV2 style = 'right: 0px; PosITION: absolute; TOP: 0px; '> <embed src = http://www.pcqc.com.cn/web/rdgqcq/dl/images/rdcq.swf width = 150 height = 400 quality = high pluginspage = http://www.macromedia.com/go/getflashplayer type = application/x-shockwave-flash scale = exactfit wmode = transparent id = eccooad> </ embed> </div>"
Document. write (sidebar1 );
Document. write (sidebar2 );
// After the following paragraph is deleted, the couplet will not move along with the screen.
Window. setInterval ("heartBeat2 ()", 1 );
// -->
Function closeAD ()
{
Document. getElementById ("leftDIV2"). style. display = 'none ';
Document. getElementById ("rightDIV2"). style. display = 'none ';
}
After searching online, I found a good code.Xmlns = "http://www.w3.org/1999/xhtml">
X
X