//文字纵向滚动 function zongxianggundong(id) { var $this = $("#"+id); var scrolltimer; $this.hover(function() { clearinterval(scrolltimer); }, function() { scrolltimer = setinterval(function() { scrollnews($this); },3000); }).trigger("mouseleave"); } function scrollnews(obj) { var $self = obj.find("ul"); var lineheight = $self.find("li:first").height(); $self.animate({ "margintop": -lineheight + "px" },500, function() { $self.css({ margintop: 0 }).find("li:first").appendto($self); }) }