<html> <head> <title>OnScroll Example</title> <script type="text/javascript"> window.onscroll = function () ...{ var oWatermark = document.getElementById("divWatermark"); oWatermark.style.top = document.body.scrollTop+(document.body.offsetHeight/2)-oWatermark.offsetHeight/2; oWatermark.style.left =(document.body.offsetWidth/2)-oWatermark.offsetWidth/2; } </script> </head> <body> <p>Try scrolling this window.</p> <div id="divWatermark" style="position: absolute; top: 0px; right: 0px; color: #cccccc; width: 150px; height: 30px; background-color: navy">Watermark</div> <p>Line 1</p> <p>Line 2</p> <p>Line 3</p> <p>Line 4</p> <p>Line 5</p> <p>Line 6</p> <p>Line 7</p> <p>Line 8</p> <p>Line 9</p> <p>Line 10</p> <p>Line 11</p> <p>Line 12</p> <p>Line 12</p> <p>Line 12</p> <p>Line 12</p> <p>Line 12</p> <p>Line 12</p> <p>Line 12</p> <p>Line 12</p> </body></html> 只要搞清楚 document.body.scrollTop是哪段距离就可以了