文件名称:10个至强JavaScript代码
文件大小:5.44MB
文件格式:RAR
更新时间:2012-03-22 14:29:05
10 个 至强 JS 代码
); } /* ==== add mouse wheel events ==== */ if (window.addEventListener) this.oc.addEventListener('DOMMouseScroll', function(e) { this.parent.scroll(-e.detail); }, false); else this.oc.onmousewheel = function () { this.parent.scroll(event.wheelDelta); } /* ==== scrollbar drag N drop ==== */ this.bar.onmousedown = function (e) { if (!e) e = window.event; var scl = e.screenX - this.offsetLeft; var self = this.parent; /* ---- move bar ---- */ this.parent.oc.onmousemove = function (e) { if (!e) e = window.event; self.bar.style.left = Math.round(Math.min((self.ws - self.arw - self.bw), Math.max(self.alw, e.screenX - scl))) + 'px'; self.view = Math.round(((e.screenX - scl) ) / (self.ws - self.alw - self.arw - self.bw) * self.NF); if (self.view != self.back) self.calc(); return false; } /* ---- release scrollbar ---- */ this.parent.oc.onmouseup = function (e) { self.oc.onmousemove = null; return false; } return false;