How to Use jQyery to implement carousel

Source: Internet
Author: User
I believe everyone will see the effects of a carousel on all major websites, so I can't help but think about it. I checked the information and read the principles of the carousel, I tried to do it slowly, and the final effect was strong, but I still want to summarize it. Maybe it will help some friends who need it. Let's take a look at it. Implementation Principle

Think about it.

    The width property value is set very wide until all your images can be mounted, and each image is used
  • And left floating.

    So when we move ul to the left and the distance is

  • , The second
  • Not moved

    In this way, the image will not be displayed one by one?

    Next we are setting

    Overflow: hidden, then

    The image outside the window is not displayed. Only the image that is moved to the current window is displayed. Is it perfect!

    After talking about some principles, let's go directly to the code. Remember to introduce jquery.

    This is the layout of p. Remember to add a border when doing so and delete it after doing so as to facilitate testing.

    1 2 3 4 5

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.