今天解决了一个Js的问题。心情倍儿爽,特此纪念下 :D 。
具体是: 在Android手机上(某些华为的型号)用js加载的轮播图不能左右滑动。
解决方案:
对需要左右平滑的图片添加以下代码:
$('.bigPic .spic').on('touchstart',function(){
document.addEventListener('touchmove', handleMouseMove true);
});
function handleMouseMove(event){
event.preventDefault();//关键在这
}
其中'.bigPic .spic'为加载轮播图的类。
具体是: 在Android手机上(某些华为的型号)用js加载的轮播图不能左右滑动。
解决方案:
对需要左右平滑的图片添加以下代码:
$('.bigPic .spic').on('touchstart',function(){
document.addEventListener('touchmove', handleMouseMove true);
});
function handleMouseMove(event){
event.preventDefault();//关键在这
}
其中'.bigPic .spic'为加载轮播图的类。