/** * jquery.marquee - scrolling text like old marquee element * @author aamir afridi - aamirafridi(at)gmail(dot)com / http://aamirafridi.com/jquery/jquery-marquee-plugin */ ;(function(d){d.fn.marquee=function(w){return this.each(function(){var a=d.extend({},d.fn.marquee.defaults,w),b=d(this),c,k,p,q,h,l=3,x="animation-play-state",e=!1,b=function(a,b,c){for(var d=["webkit","moz","ms","o",""],e=0;e');var f=b.find(".js-marquee").css({"margin-right":a.gap,"float":"left"});a.duplicated&&f.clone(!0).appendto(b);b.wrapinner('
');c=b.find(".js-marquee-wrapper"); if(q){var m=b.height();c.removeattr("style");b.height(m);b.find(".js-marquee").css({"float":"none","margin-bottom":a.gap,"margin-right":0});a.duplicated&&b.find(".js-marquee:last").css({"margin-bottom":0});var s=b.find(".js-marquee:first").height()+a.gap;a.duration*=(parseint(s,10)+parseint(m,10))/parseint(m,10)}else h=b.find(".js-marquee:first").width()+a.gap,k=b.width(),a.duration*=(parseint(h,10)+parseint(k,10))/parseint(k,10);a.duplicated&&(a.duration/=2);if(a.allowcss3support){var f=document.body|| document.createelement("div"),n="marqueeanimation-"+math.floor(1e7*math.random()),z=["webkit","moz","o","ms","khtml"],a="animation",t="",u="";f.style.animation&&(u="@keyframes "+n+" ",e=!0);if(!1===e)for(var y=0;y"+f+"");b(c[0],"animationiteration",function(){b.trigger("finished")});b(c[0],"animationend",function(){v();b.trigger("finished")})}else c.animate(p,a.duration,a.easing,function(){b.trigger("finished");a.pauseoncycle?b.timer=settimeout(v,a.delaybeforestart):v()});b.data("runningstatus","resumed")};b.bind("pause", g.pause);b.bind("resume",g.resume);a.pauseonhover&&b.bind("mouseenter mouseleave",g.toggle);e&&a.allowcss3support?v():b.timer=settimeout(v,a.delaybeforestart)}})};d.fn.marquee.defaults={allowcss3support:!0,css3easing:"linear",easing:"linear",delaybeforestart:1e3,direction:"left",duplicated:!1,duration:5e3,gap:20,pauseoncycle:!1,pauseonhover:!1}})(jquery);