Home > Web Front-end > JS Tutorial > jquery seamless scroll up implementation code_jquery

jquery seamless scroll up implementation code_jquery

WBOY
Release: 2016-05-16 17:39:05
Original
959 people have browsed it
JS part
Copy code The code is as follows:

$(function (){
var $this = $(".renav");
var scrollTimer;
$this.hover(function(){
clearInterval(scrollTimer);
},function (){
scrollTimer = setInterval(function(){
scrollNews( $this );
}, 2000 );
}).trigger("mouseout");
});
function scrollNews(obj){
var $self = obj.find("ul:first");
var lineHeight = $self.find("li:first").height();
$self.animate({ "margin-top" : -lineHeight "px" },600 , function(){
$self.css({"margin-top":"0px"}).find( "li:first").appendTo($self);
})
}

HTML part
Copy code The code is as follows:



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template