WeChat applets are easy to use and use swiper to achieve image rotation

Source: Internet
Author: User
In the previous article, we configured the wxss of the applet to achieve horizontal and vertical layout in the container component view. in this article, we use the swiper label to achieve image rotation. The round effect can be seen on many websites or mobile app terminals. in the small program, the swiper component is used to rotate images. the effect of today's small example is as follows: in the previous article, we configured the wxss of the applet to achieve horizontal and vertical layout in the container component view. in this article, we use the swiper label to achieve image rotation.


The round effect can be seen on many websites or mobile app terminals. in the small program, the swiper component is used to rotate images. the effect of today's small example is as follows:

To facilitate the demonstration, I adjusted the animation switching interval to 3 s, and the actual project is generally 5 s, depending on the project requirements.

The swiper slider view container component is used to implement image rotation. the page structure file code is as follows:

   
       
            
                 
                     
                   
              
         
    
 

Ignore the parent container view and component attributes of the outermost layer. The structure of the page file is simplified as follows:

           
                
                     
                  
             
    
 

The code above shows that there is a swiper component in the code of the entire round chart, which consists of multiple swiper-item components. The swiper-item contains an image.

Is bound to an imgUrls array, and the component is repeatedly rendered using the data in the array. The block tag is not rendered on the page. For more information, see the official documentation:

Https://mp.weixin.qq.com/debug/wxadoc/dev/framework/view/wxml/list.html? T = 201715

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.