获取窗口相对于屏幕左边和上边的位置:
http://www.codeweblog.com/js%E8%8E%B7%E5%8F%96%E7%AA%97%E5%8F%A3%E7%9B%B8%E5%AF%B9%E4%BA%8E%E5%B1%8F%E5%B9%95%E5%B7%A6%E8%BE%B9%E5%92%8C%E4%B8%8A%E8%BE%B9%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%9D%90%E6%A0%87/
var x=window.screenLeft?window.screenLeft: window.screenX ;
var y=window.screenTop?window.screenTop: window.screenY;
alert(x+" "+y);