墨色风雨
var dbody=document.getElementsByClassName('wrap')[0];//ff用objAddEvent(document,'DOMMouseScroll', function(e){return mouse_scroll(e);}) //非ff chrome 用objAddEvent(document,'mousewheel', function(e){return mouse_scroll(e);}) //chrome用objAddEvent(dbody,'mousewheel', function(e){return mouse_scroll(e);})function mouse_scroll(e){e=e || window.event;var delD=e.wheelDelta?e.wheelDelta: -e.detail*40;//判断上下方向var move_s=delD>0?-50:50;document.documentElement.scrollLeft+=move_s; //非chrome浏览器用这个//chrome浏览器用这个if(document.documentElement.scrollLeft==0)document.body.scrollLeft+=move_s; return false;}//这个是给对象增加监控方法的函数function objAddEvent(oEle, sEventName, fnHandler){if(oEle.attachEvent) oEle.attachEvent('on'+sEventName, fnHandler);else oEle.addEventListener(sEventName, fnHandler, false);}