Swiper Tutorial--swiper Basics of Use (20)

Source: Internet
Author: User

This article is the official HTML5 training course Swiper Tutorial for h5edu institutions.
This content we introduce Swiper to add the mouse wheel Control page scrolling.

It is customary to build a basic Swiper page and set CSS styles.

<div class= "Swiper-container" >            <div class= "Swiper-wrapper" >                <div class= "Swiper-slide" > h5edu 1</div>                <div class= "swiper-slide" >h5edu 2 </div>                <div class= "swiper-slide" >h5edu 3</div>                <div class= " Swiper-slide ">h5edu 4</div>                <div class=" Swiper-slide ">h5edu 5</div>            </div>            <div class= "swiper-pagination" ></div>        </ Div>  

Then initialize it in JS and add the mouse wheel to control the paging properties.

var swiper = new Swiper ('. Swiper-container ', {               pagination: '. Swiper-pagination ',               paginationclickable:true,               spacebetween:30,               slidesperview:1,               direction: ' Vertical ',               mousewheelcontrol:true  // Turn on the mouse to control the paging property            });  

This way, when we slide the mouse wheel in the page, we can flip the top and bottom pages.

Click to enter Swiper Intensive tutorial: http://h5edu.cn/htm/step/h5edu_893.html

Swiper Tutorial--swiper Basics of Use (20)

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.