zoukankan      html  css  js  c++  java
  • BetterScroll使用

    IScroll需要关注的问题太多,甚至有些企业微信电脑端无法滑动,同样的win10同样的企业微信版本不同的电脑有时都不行,查不出来原因,今天决定把他换了试验下,首先技术选型

    1、MeScroll

    http://www.mescroll.com/

    2、BetterScroll

    https://github.com/ustbhuangyi/better-scroll

    首先使用Mescroll,官网做的不错,但是在Jquery方式下,直接替换不太成功,感觉和Iscroll差别较大,改使用BetterScroll

    3、固定列表用法示例

    <script src="https://unpkg.com/@better-scroll/core@latest/dist/core.min.js"></script>
    
    let wrapper = document.getElementById("wrapper")
    let bs = new BScroll(wrapper, {})
    
    <div class="wrapper">
      <ul class="content">
        <li>...</li>
        <li>...</li>
        ...
      </ul>
      <!-- you can put some other DOMs here, it won't affect the scrolling
    </div> 

    4、使用例子

     let wrapper = document.getElementById("wrapper")
                if (myScroll == null || myScroll == undefined) {
                    myScroll = BetterScroll.createBScroll(wrapper, {
                        click: true, taps: true, pullUpLoad: {
                            threshold: 10
                        }
                    });
                    myScroll.on('pullingUp', function () {
                        $("#divscroll").height('');
                        $("#divscroll").height($("#divscroll").height() + 20);
                        myScroll.refresh();
                        myScroll.finishPullUp();
                    })
                } else {
                    $("#divscroll").height('');
                    $("#divscroll").height($("#divscroll").height() + 20);
                    myScroll.refresh();
                }
    

      

    4、感觉BetterScroll滚动效果不如IScroll,观察客户电脑手机情况中。 

    后续:IScroll出现的问题,BetterScroll依然有,没有客户的环境,暂时无解  

  • 相关阅读:
    Debian 8(jessie)下设置系统启动直接进入命令行,无GUI
    Unity 查找物体对象
    Unity的生命周期函数
    Unity脚本实现添加子物体
    Unity工程中 .Meta 文件
    Unity 中简单的第三人称摄像机跟随
    github删除自己的库--Deleting a repository
    TypeScript函数
    Egret引擎学习笔记
    Egret引擎list内单个渲染对象代码编写
  • 原文地址:https://www.cnblogs.com/zhaogaojian/p/13921993.html
Copyright © 2011-2022 走看看