/*!
 * jQuery News Ticker Plug-In
 * http://github.com/tetsuwo/jquery-news-ticker
 *
 * Copyright 2012, Tetsuwo OISHI
 * Dual licensed under the MIT license.
 */
(function(f){f.fn.newsTicker=function(h){var b=f(this),d={},e={},g=!0,c=0,d=f.extend({debug:!1,itemTitleChars:10,minItem:0,maxItem:10,scrollStep:5,scrollSecond:0.07,interval:2E3,animationType:"scroll",classNamePrefix:"jq-news-ticker-"},h);this.debug=function(a){d.debug&&console.log(a)};this.getConfig=function(){return d};this.setPointer=function(a){$self.debug("setPointer = "+a);c=a;return $self.getPointer()};this.getPointer=function(){$self.debug("getPointer = "+c);return c};this.getClassName=function(a,
b){return(b?"":".")+d.classNamePrefix+a};this.getItems=function(){return b.find($self.getClassName("item"))};this.getItem=function(a){return b.find($self.getClassName("item")).eq(a)};this.getCurrentItem=function(){return $self.getItem(c)};this.animateCallback=function(){c++;$self.getItems().length<=c&&(c=0);$self.setPointer(c);$self.start()};e.scrollFunc=function(){var a=$self.getCurrentItem(),b=a.position();e.targetPoint>b.left?(a.css("left",e.targetPoint-100),window.setTimeout($self.animateCallback,
d.interval)):(a.css("left",b.left-d.scrollStep),window.setTimeout(arguments.callee,1E3*d.scrollSecond))};this.setItem=function(a){g=!1;b.find($self.getClassName("item-focus")).removeClass($self.getClassName("item-focus",!0)).hide();a=$self.getItem(a);a.addClass($self.getClassName("item-focus",!0));$self.debug("root.width = "+b.width());$self.debug("target.width = "+a.width());var c=b.width()<a.width();e.targetPoint=c?b.width()-a.width():0;e.targetPoint-=b.width();switch(d.animationType){case "scroll":c=
parseInt(b.css("paddingLeft"))+parseInt(b.css("paddingRight"));a.css("left",b.width()+c).show();a.animate({left:0},function(){window.setTimeout(e.scrollFunc,1E3)});break;default:a.fadeIn($self.animateCallback)}};this.start=function(){$self.setItem(c)};this.tick=function(){var a=$self.getItems();$self.debug(a.length);if(g)return $self.start();window.setTimeout($self.start,d.interval)};this.debug(d);$self=this;f(function(){1>$self.getItems().length?$self.debug("Not Found News"):$self.tick()});return this}})(jQuery);

/*!
 * jQuery News Ticker Plug-In
 * http://github.com/tetsuwo/jquery-news-ticker
 *
 * Copyright 2012, Tetsuwo OISHI
 * Dual licensed under the MIT license.
 */
(function(f){f.fn.newsTicker=function(h){var b=f(this),d={},e={},g=!0,c=0,d=f.extend({debug:!1,scrollStep:5,scrollSecond:0.07,interval:2E3,animationType:"scroll",classNamePrefix:"jq-news-ticker-"},h);this.debug=function(a){d.debug&&console.log(a)};this.getConfig=function(){return d};this.setPointer=function(a){$self.debug("setPointer = "+a);c=a;return $self.getPointer()};this.getPointer=function(){$self.debug("getPointer = "+c);return c};this.getClassName=function(a,b){return(b?"":".")+d.classNamePrefix+
a};this.getItems=function(){return b.find($self.getClassName("item"))};this.getItem=function(a){return b.find($self.getClassName("item")).eq(a)};this.getCurrentItem=function(){return $self.getItem(c)};this.animateCallback=function(){c++;$self.getItems().length<=c&&(c=0);$self.setPointer(c);$self.start()};e.scrollFunc=function(){var a=$self.getCurrentItem(),b=a.position();e.targetPoint>b.left?(a.css("left",e.targetPoint-100),window.setTimeout($self.animateCallback,d.interval)):(a.css("left",b.left-
d.scrollStep),window.setTimeout(arguments.callee,1E3*d.scrollSecond))};this.setItem=function(a){g=!1;b.find($self.getClassName("item-focus")).removeClass($self.getClassName("item-focus",!0)).hide();a=$self.getItem(a);a.addClass($self.getClassName("item-focus",!0));$self.debug("root.width = "+b.width());$self.debug("target.width = "+a.width());var c=b.width()<a.width();e.targetPoint=c?b.width()-a.width():0;e.targetPoint-=b.width();switch(d.animationType){case "scroll":c=parseInt(b.css("paddingLeft"))+
parseInt(b.css("paddingRight"));a.css("left",b.width()+c).show();a.animate({left:0},function(){window.setTimeout(e.scrollFunc,1E3)});break;default:a.fadeIn($self.animateCallback)}};this.start=function(){$self.setItem(c)};this.tick=function(){var a=$self.getItems();$self.debug(a.length);if(g)return $self.start();window.setTimeout($self.start,d.interval)};this.debug(d);$self=this;f(function(){1>$self.getItems().length?$self.debug("Not Found News"):$self.tick()});return this}})(jQuery);

update minified version