Android不支持web页滚动
16lz
2021-01-23
Android不支持web页滚动,以下答案来源网络其他人的回答,德问网上有。
测试以下方法可行。
function noBarsOnTouchScreen(arg){ var elem, tx, ty; if('ontouchstart' in document.documentElement ) { if (elem = document.getElementById(arg)) { elem.style.overflow = 'hidden'; elem.ontouchstart = ts; elem.ontouchmove = tm; } } function ts( e ) { var tch; if( e.touches.length == 1 ) { e.stopPropagation(); tch = e.touches[ 0 ]; tx = tch.pageX; ty = tch.pageY; } } function tm( e ) { var tch; if( e.touches.length == 1 ) { e.preventDefault(); e.stopPropagation(); tch = e.touches[ 0 ]; this.scrollTop += ty - tch.pageY; ty = tch.pageY; } }}//调用的时候:noBarsOnTouchScreen(divId);
更多相关文章
- Android - Android 面试题集 -- Android 部分答案
- Android初级工程师面试题答案——Android题型
- 《Android移动应用基础教程》(Android Studio)(第二版)黑马教程 课后
- Android面试题收集(有具体答案)
- 《Android移动应用基础教程》(Android Studio)(第二版)黑马教程 课后
- Android 面试题集 & 答案,助你拿到心仪 Offer
- 《Android移动应用基础教程》(Android Studio)(第二版)黑马教程 课后