<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body style=" margin:0;" mce_style=" margin:0;"> <div id="Layer1" style="background-color:#CCC; width:108px; height:200px; position:absolute;"></div> <mce:script type="text/javascript"><!-- var f_div=document.getElementById("Layer1"); f_div.style.marginLeft=(screen.width-parseInt(f_div.style.width)-22)+"px"; //调整距离顶部的距离 f_div.style.marginTop=window.screen.availHeight/3+"px"; var tTop=parseInt(f_div.style.marginTop); window.οnscrοll=function(){ var scrollPos; if (typeof window.pageYOffset != 'undefined') { scrollPos = window.pageYOffset; } else if (typeof document.compatMode != 'undefined' && document.compatMode != 'BackCompat') { scrollPos = document.documentElement.scrollTop; } else if (typeof document.body != 'undefined') { scrollPos = document.body.scrollTop; } f_div.style.marginTop=tTop+scrollPos+"px"; } // --></mce:script><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> </body> </html>