Pure CSS3 Code Write seamless scrolling effect

Source: Internet
Author: User

Mainly used in the CSS3 animation @keyframes, animation.

The layout is the outer one div width fixed, then overflow hidden absolute positioning, inside the UL fixed positioning. The effect is achieved by adding animations to the UL. The specific code is as follows

1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4   <MetaCharSet= "UTF-8">5   <title>Document</title>6 </Head>7 <styletype= "Text/css">8   *{margin:0;padding:0;}9 ul Li{List-style:None;}Ten . Banner{width:100%;Height:568px;Overflow:Hidden;position:relative;} One . Banner ul{ A width:500%; - position:Absolute; -  Left:0; the Top:0; - Height:568px; - -webkit-animation:Slide 10s linear infinite; -   } + . Banner ul Li{ - float: Left; + width:20%; A Height:568px; at   } - . Banner ul li:nth-child (1){background:URL (img/1.jpg) center; } - . Banner ul li:nth-child (2){background:URL (img/2.jpg) center; } - . Banner ul li:nth-child (3){background:URL (img/3.jpg) center; } - . Banner ul Li:nth-child (4){background:URL (img/4.jpg) center; } - . Banner ul Li:nth-child (5){background:URL (img/5.jpg) center; } in @-webkit-keyframes Slide{ - 0%{left:0;} to 20%{ Left:0;} + 21%{ Left:-100%;} - 40%{ Left:-100%;} the 41%{ Left:-200%;} * 60%{ Left:-200%;} $ 61%{ Left:-300%;}Panax Notoginseng 80%{ Left:-300%;} - 81%{ Left:-400%;} the 100%{ Left:-400%;} +   } A . Banner:hover ul{-webkit-animation-play-state:paused;} the </style> + <Body> -   <Divclass= "banner"> $     <ul> $       <Li></Li> -       <Li></Li> -       <Li></Li> the       <Li></Li> -       <Li></Li>Wuyi     </ul> the   </Div> - </Body> Wu </HTML>
View Code

Pure CSS3 Code Write seamless scrolling effect

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.