Home  >  Q&A  >  body text

javascript - iScroll5 ios cannot slide, Android has no problem

$("#choose").on("click",function(){
           $(".mask").css("display","block");
           $(".choose_box").css('display',"block");
           var liHeight=parseInt($('#num li').css("height"));
           var numScroll= new IScroll('#num', {
                scrollY: true,
                listenY: true,
                tap:true,
                momentum: false,
                snap: 'li' 
            })
            numScroll.goToPage(0,0);
            numScroll.refresh();
            numScroll.on('scrollEnd',function(){            
                var numHeight=Math.abs(this.y);
                numIndex=parseInt(numHeight/liHeight);
                chooseNum=numIndex;
                numScroll.refresh();        
           })    
})

The mobile mask layer sliding selector made by a front-end rookie went through a lot of pitfalls. Finally, the Android test was completed, but the iOS test found that it could not slide -_-||. I don’t know where the problem is (guessing that the initialization on the ios side failed. Absolute is used for positioning)

仅有的幸福仅有的幸福2635 days ago768

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-07-05 10:50:51

    Print the height of the wrapper you want to add sliding on the page to see if it is consistent with the height you set. If the height is not set, but the height is expanded by the content, there may be situations where the slider will not move.

    reply
    0
  • 巴扎黑

    巴扎黑2017-07-05 10:50:51

    The test is OK, but the problem is that wrapp does not set the height. I still don’t understand it thoroughly enough, so my reply is late. Thank you again, God

    reply
    0
  • Cancelreply