芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/www/midiatech/modules/vendor/jquery.marquee.min.js
/** * author Remy Sharp * url http://remysharp.com/tag/marquee */ (function(e){e.fn.marquee=function(t){function i(e,t,n){var r=n.behavior,i=n.width,s=n.dir;var o=0;if(r=="alternate"){o=e==1?t[n.widthAxis]-i*2:i}else if(r=="slide"){if(e==-1){o=s==-1?t[n.widthAxis]:i}else{o=s==-1?t[n.widthAxis]-i*2:0}}else{o=e==-1?t[n.widthAxis]:0}return o}function s(){var t=n.length,r=null,o=null,u={},a=[],f=false;while(t--){r=n[t];o=e(r);u=o.data("marqueeState");if(o.data("paused")!==true){r[u.axis]+=u.scrollamount*u.dir;f=u.dir==-1?r[u.axis]<=i(u.dir*-1,r,u):r[u.axis]>=i(u.dir*-1,r,u);if(u.behavior=="scroll"&&u.last==r[u.axis]||u.behavior=="alternate"&&f&&u.last!=-1||u.behavior=="slide"&&f&&u.last!=-1){if(u.behavior=="alternate"){u.dir*=-1}u.last=-1;o.trigger("stop");u.loops--;if(u.loops===0){if(u.behavior!="slide"){r[u.axis]=i(u.dir,r,u)}else{r[u.axis]=i(u.dir*-1,r,u)}o.trigger("end")}else{a.push(r);o.trigger("start");r[u.axis]=i(u.dir,r,u)}}else{a.push(r)}u.last=r[u.axis];o.data("marqueeState",u)}else{a.push(r)}}n=a;if(n.length){setTimeout(s,25)}}var n=[],r=this.length;this.each(function(o){var u=e(this),a=u.attr("width")||u.width(),f=u.attr("height")||u.height(),l=u.after("
'+u.html()+"
").next(),c=l.get(0),h=0,p=(u.attr("direction")||"left").toLowerCase(),d={dir:/down|right/.test(p)?-1:1,axis:/left|right/.test(p)?"scrollLeft":"scrollTop",widthAxis:/left|right/.test(p)?"scrollWidth":"scrollHeight",last:-1,loops:u.attr("loop")||-1,scrollamount:u.attr("scrollamount")||this.scrollAmount||2,behavior:(u.attr("behavior")||"scroll").toLowerCase(),width:/left|right/.test(p)?a:f};if(u.attr("loop")==-1&&d.behavior=="slide"){d.loops=1}u.remove();if(/left|right/.test(p)){l.find("> div").css("padding","0 "+a+"px")}else{l.find("> div").css("padding",f+"px 0")}l.bind("stop",function(){l.data("paused",true)}).bind("pause",function(){l.data("paused",true)}).bind("start",function(){l.data("paused",false)}).bind("unpause",function(){l.data("paused",false)}).data("marqueeState",d);n.push(c);c[d.axis]=i(d.dir,c,d);l.trigger("start");if(o+1==r){s()}});return e(n)}})(jQuery)