"Classroom Example" carousel diagram

Source: Internet
Author: User

Target

Make a carousel diagram with 5 images

Analysis

To make a carousel diagram, you need the following 3 steps:

1, after the page opens, the first picture shows, the rest of the picture, hidden

2, the picture interval 5 seconds to turn the broadcast once

3, to the 5th map back to the 1th sheet

Production

1, after the page opens, the first picture shows, the rest of the picture, hidden:

$ (". BG"). Not (": eq (0)"). Hide ();

2, Interval 5 seconds Carousel:

Var i=0;

$ (function () {

$ (". BG"). Not (": eq (0)"). Hide (); First photo hidden

SetInterval (function () {

i++;

$ (". BG"). EQ (i). Show (); The first picture shows

$ (". BG"). Not (": eq (" +i+ ")"). Hide (); Not the I-picture hidden

},5000);

})

3. Go to the 1th after uploading to the 5th figure:

if (i==5)

{

i=0;

}

"Complete Program"

Var i=0;

$ (function () {

$ (". BG"). Not (": eq (0)"). Hide (); First photo hidden

SetInterval (function () {

i++;

if (i==5)

{

i=0;

}

$ (". BG"). EQ (i). Show (); The first picture shows

$ (". BG"). Not (": eq (" +i+ ")"). Hide (); Not the I-picture hidden

},5000);

})

"Classroom Example" carousel diagram

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.