这个是IE 11 下兼容下视图测试时可用. $(window).bind('beforeunload', function (event) { var _this = this; var x = event.originalEvent.clientX; var y = event.originalEvent.clientY; || event.altKey) { // alert("ok"); $.post("/admin/login/ClearSesssion",…
//第一.相对于屏幕 function getMousePos(event) { var e = event || window.event; return {'x':e.screenX,'y':screenY} } //第二.相对于浏览器 function getMousePos(event) { var e = event || window.event; return {'x':e.clientX,'y':clientY} } //第三.相对于文档 function getMousePos…
if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(pos) { model.address.geo = { lat: pos.coords.latitude.toFixed(5), lng: pos.coords.longitude.toFixed(5) }; }); } else { alert("Geolocation is not supported by this browser.…
1.js获取对象的绝对坐标 方法1: function getAbsPoint(e) { var x = e.offsetLeft, y = e.offsetTop; while(e=e.offsetParent) { x += e.offsetLeft; y += e.offsetTop; } alert("x:"+x+","+"y:"+y); } 方法2: function getAbsPoint(obj) { var x,y; oRect…