javascript - iScroll5 ios cannot slide, Android has no problem
仅有的幸福
仅有的幸福 2017-07-05 10:48:51
0
2
851
$("#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)

仅有的幸福
仅有的幸福

reply all(2)
巴扎黑

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.

巴扎黑

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template