//速率函数 jquery.easing.jswing = jquery.easing.swing; jquery.extend(jquery.easing, { def: "easeoutquad", easeinoutquad: function(e, f, a, h, g) { if ((f /= g / 2) < 1) { return h / 2 * f * f + a } return -h / 2 * ((--f) * (f - 2) - 1) + a }, easeoutquart: function(e, f, a, h, g) { return -h * ((f = f / g - 1) * f * f * f - 1) + a }, }); // 鼠标滚轮函数 (function(a) { function d(b) { var c = b || window.event, d = [].slice.call(arguments, 1), e = 0, f = !0, g = 0, h = 0; return b = a.event.fix(c), b.type = "mousewheel", c.wheeldelta && (e = c.wheeldelta / 120), c.detail && (e = -c.detail / 3), h = e, c.axis !== undefined && c.axis === c.horizontal_axis && (h = 0, g = -1 * e), c.wheeldeltay !== undefined && (h = c.wheeldeltay / 120), c.wheeldeltax !== undefined && (g = -1 * c.wheeldeltax / 120), d.unshift(b, e, g, h), (a.event.dispatch || a.event.handle).apply(this, d) } var b = ["dommousescroll", "mousewheel"]; if (a.event.fixhooks) for (var c = b.length; c;) a.event.fixhooks[b[--c]] = a.event.mousehooks; a.event.special.mousewheel = { setup: function() { if (this.addeventlistener) for (var a = b.length; a;) this.addeventlistener(b[--a], d, !1); else this.onmousewheel = d }, teardown: function() { if (this.removeeventlistener) for (var a = b.length; a;) this.removeeventlistener(b[--a], d, !1); else this.onmousewheel = null } }, a.fn.extend({ mousewheel: function(a) { return a ? this.bind("mousewheel", a) : this.trigger("mousewheel") }, unmousewheel: function(a) { return this.unbind("mousewheel", a) } }); })(jquery); /**主函数 *@param {string} 组件id *@param {num} 时间节点数 */ function timebase(id, row, r, dom){ var row=parseint(row) var scope = $("#"+id); var heights = []; for (var i=0; i -sumheight(h)) { d++; b--; a=!1; scope.find(".p_articles").eq(d-1).liout(); scope.find(".p_articles").eq(d+row-1).liin(); scope.find(".p_articles:first").animate({margintop:-sumheight(math.abs(b))},600,"easeinoutquad",function(){ a=!0; }); } } function adown() { if (a && 0!=parseint(scope.find(".p_articles:first").css("margintop"))){ b++; d--; a=!1; scope.find(".p_articles").eq(d).liin(); scope.find(".p_articles").eq(d+row).liout(); scope.find(".p_articles:first").animate({margintop:-sumheight(math.abs(b))},600,"easeinoutquad",function(){ a=!0; }); } } scope.find(".p_articles").mouseover(function(){ scope.find(".p_articles").removeclass("hover"); this.classname += " hover"; }); var b=0,f=scope.find(".p_articles").length,d=0,a=!0,c; var h=f-row; $.fn.liout=function(){ $(this).find(".p_timebox").animate({left:"-300px"},500,"easeoutquart"); $(this).find(".p_contentbox").animate({right:"-900px"},500,"easeoutquart") }; $.fn.liin=function(){ $(this).find(".p_timebox").animate({left:"0px"},500,"easeoutquart"); $(this).find(".p_contentbox").animate({right:"0px"},500,"easeoutquart") }; scope.find(".p_news").mousewheel(function(b,c){ math.abs(c); if(a){ var d=parseint(scope.find(".p_articles:first").css("margintop")); 0-sumheight(h)&&aup(); } r.lazyimg({defobj:"#c_"+dom}); }); scope.find(".p_articles:gt("+(row-1)+")").find(".p_timebox").css({left:"-300px"}); scope.find(".p_articles:gt("+(row-1)+")").find(".p_contentbox").css({right:"-900px"}); }