会议室预订系统 鼠标位置

w

 

    var ev = event || window.event;
    var mousePos = mousePosition(ev);
 

    function mousePosition(ev) {
        if (ev.pageX || ev.pageY) {
            return {x: ev.pageX, y: ev.pageY};
        }
        return {
            x: ev.clientX + document.body.scrollLeft - document.body.clientLeft,
            y: ev.clientY + document.body.scrollTop - document.body.clientTop
        };
    }

 

 

posted @ 2017-03-17 11:10  papering  阅读(153)  评论(0编辑  收藏  举报