[Jquery] Some treasure picture carousel (Seamless)

Source: Internet
Author: User

Ideas

1. Structure and Style

① the outermost div box when the container, inside the UL width is infinitely large and relative positioning (the move is actually moving the UL left)

② button transparency can be done with Background:rgba ()

③ the last picture immediately after the first one, the first one immediately before the last, that is 5123451 (do not do two pictures no way to stick together), it is the key to seamless

2.js

① Each click of the button, moving the UL distance is, the current image index * picture width

② when moving to the "6" picture (that is, 5 after the 1), should immediately pull him back to 1 position, but note that this judgment instantly pull back the statement, should be written in animate function, to ensure that the animation after the completion of the flawless pull back, rather than in parallel with animate, That will move left to the first, instead of seamlessly right-scrolling to the first one, and vice versa.

③ Click too fast there will be bugs, always fast dot picture moved empty

Cause: The entire campaign is not over before the next click is made

WORKAROUND: Between two clicks, make an interval (that is, when the time interval of two clicks is greater than one value, the animation is performed)

[Jquery] Some treasure picture carousel (Seamless)

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.