zoukankan      html  css  js  c++  java
  • 记录-移动端网页触摸内容滑动js插件

    需求:

    在webapp中需要左右滑动手机,移动主页的轮播图。也可用在引导页(欢迎页)的大图左右滑动

    可用:

    百度:swiper插件

    在项目中导入插件,这里只有部分代码,具体百度swiper



    <link rel="stylesheet" href="/res/vankemobilestyle/css/swiper.css">


    <
    div class="index_roll"> <div class="swiper-container"> <div class="swiper-wrapper" id="homeShufflingImage" style="auto"> </div> <!-- Add Pagination --> <div class="swiper-pagination" ></div> </div> <script> $(function(){ if(!$.cookie('hasWatch')){ $("#homeShufflingImage").append('<div class="swiper-slide" style="text-align: center; auto"><img src="../res/vankemobilestyle/images/guide01.jpg" width="100%"/></div>' +'<div class="swiper-slide" style="text-align: center; auto"><img alt="" src="../res/vankemobilestyle/images/guide02.jpg" width="100%" /></div>' +'<div class="swiper-slide" style="text-align: center; auto"><img alt="" src="../res/vankemobilestyle/images/guide03.jpg" width="100%" /></div>' +'<div class="swiper-slide" style="text-align: center; auto"><img alt="" src="../res/vankemobilestyle/images/guide04.jpg" width="100%" /></div>' +'<div class="swiper-slide" style="text-align: center; auto"><a href="/webMoblie/mbNewHouse" style="height:100%;"><img alt="" src="../res/vankemobilestyle/images/guide05.png" width="100%" /></a></div>' ); //主要代码 var swiper = new Swiper('.index_roll .swiper-container', { pagination: '.swiper-pagination', paginationClickable: true, centeredSlides: true, autoplayDisableOnInteraction: false, autoplay:false }); $(".swiper-slide img").height($(window).height()); $.cookie('hasWatch', 'ture', { expires: 100, path: '/' }); } else window.location.href ='/webMoblie/mbIndex'; }) </script> </div>
  • 相关阅读:
    名言
    八猫图
    springMVC 上传下载文件
    mongdb 模糊查询
    tomcat结合nginx使用小结
    orale存储过程
    java执行效率低,但效率就低吗?
    Spring aop 原始的工作原理的理解
    spring aop一些名词的理解
    Spring控制反转(IOC)和依赖注入(DI),再记不住就去出家!
  • 原文地址:https://www.cnblogs.com/dscs/p/5005697.html
Copyright © 2011-2022 走看看