$("#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)
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