Home > Web Front-end > JS Tutorial > body text

jQuery uses array to write pictures to seamlessly scroll left_jquery

WBOY
Release: 2016-05-16 17:46:55
Original
986 people have browsed it

jQuery programming implements a set of 8 pictures. When entering the web page, the first 4 pictures are displayed initially, and then it automatically scrolls to the left until the screen stops scrolling when the last 4 pictures are displayed.
The following is the jQuery code:

Copy the code The code is as follows:

$(document) .ready(function() {
var $images = $('#images img');
var imgs = $images.length;
var next_img;
for(var i=0; inext_img=$images.eq(i);
scroll(next_img);
}
});
//Create a scrolling function, use animate function custom animation
function scroll(image) {
image.animate({'left':-485},5000);
};

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!