The native JS+CSS3 realizes the picture automatic switching, the picture carousel __js

Source: Internet
Author: User
Tags setinterval
using css3transition and opacity attributes to make picture -Carousel Animation

Oneself these two days according to use JS to control trigger CSS3 transition attribute, write to CSS3 animation as the basis, JS control process of picture carousel

Using the opacity transparency attribute of CSS3 and transition animation over property, the process is controlled by JS, and the trigger of JS to CSS3 transition animation is realized.

Instance link Address: http://pspgbhu.github.io/opacity

Today suddenly found that this code has problems, mainly in the html/css, the problem is mainly because of the use of Position:absolute positioning, while banner this div and no other elements, so this div can not be properly stretched, for our page layout has brought trouble.
The second problem is that this carousel is mainly intended for the huge banner ads at the top of the page, but it doesn't take into account the effects of different resolutions when writing code, so there's plenty of room for improvement.

Think about it or do not delete the code before the problem, the correct code on the last side

This is the previously problematic code:

<! DOCTYPE html>  

The following

is the modified code:

<! 
        DOCTYPE html> 

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.