var $ = function (flag) {
return document.getElementById(flag);
}
2.捕捉document的mousedown事件:
里面有这么一段代码:
复制代码 代码如下:
var page = {
event: function (evt) {
var ev = evt || window.event;
return ev;
},
pageX: function (evt) {
var e = this.event(evt);
return e.pageX || (e.clientX + document.body.scrollLeft - document.body.clientLeft);
},
pageY: function (evt) {
var e = this.event(evt);
return e.pageY || (e.clientY + document.body.scrollTop - document.body.clientTop);