Moving end selects age income by scale or scale sliding mode

Source: Internet
Author: User

The way of implementation with Swiper.js

(The following are examples of age)

1   <div class= ' Testtwo ' >2       <p class= ' Agesel ' > Your age is <span class= ' scroage ' > </span > Years </p>3 </div>4     <div class= "Swiper-container" >5        <span Class= "after" ></span>6        <div class= "Swiper-wrapper" >7        </div> 8     </div>

1       varagelen=762       varStrhtml= "
Dynamically generated 0-76 years old3 for(vari=0;i<agelen;i++){4strhtml+= "<div class= ' swiper-slide ' ><span>" +i+ "</span></div>"5 }6$ (". Swiper-wrapper"). Append (strhtml)7 8 varSwiper =NewSwiper ('. Swiper-container '), {9Initialslide:20,//initial age shown at 20 years oldTenPagination: '. Swiper-pagination ', OneSlidesperview:6, ACenteredslides:true, -Paginationclickable:true, -spacebetween:0, theOnInit:function(swiper) { - varlen=$ (". Swiper-slide"). Length - varlenw=$ (". Swiper-slide"). Width () -$ ('. Swiper-wrapper '). Width (len*lenw); + }, -Onslidechangeend:function(swiper) { +$ (". Scroage"). html (' +$ ('. Swiper-slide '). EQ (swiper.activeindex). Find (' span '). HTML () + ") Ascroage=$ ('. Swiper-slide '). EQ (swiper.activeindex). Find (' span '). HTML () at //Console.log ($ ('. Swiper-slide '). EQ (swiper.activeindex). HTML ())//switch at the end, tell me how many slide are now - } -});

Moving end selects age income by scale or scale sliding mode

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.