/** * Created by weber on 2015/1/30. */ /** * @author feiwen */ (function($){ $.fn.textSlider = function(settings){ settings = jQuery.extend({ speed : "normal", line : 2, timer : 1000 }, settings); return this.each(function() { $.fn.textSlider.scllor( $( this ), settings ); }); }; $.fn.textSlider.scllor = function($this, settings){ //alert($this.html()); var ul = $( "ul:eq(0)", $this ); var timerID; var li = ul.children(); var _btnUp=$(".up:eq(0)", $this) var _btnDown=$(".down:eq(0)", $this) var liHight=$(li[0]).height(); var upHeight=0-settings.line*liHight;//滚动的高度; var scrollUp=function(){ _btnUp.unbind("click",scrollUp); ul.animate({marginTop:upHeight},settings.speed,function(){ for(i=0;i