3d 逐侦图文 素材
javascript PART分代码
var 단계 = 0;
var 첫 번째 = 0;
var lth = document.querySelectorAll('#tobj img').length;
window.addEventListener('touchstart',function(e){
e.preventDefault();
first = e.touches[0].pageX;
})
window.addEventListener('touchmove',function(e){
e.preventDefault();
var x = e.pageX || e.touches[0].pageX;
document.getElementById(' outs').innerHTML = 단계;
if(Math.abs(x - first)>10){
document.querySelectorAll('#tobj img')[step].style.display = 'none'
if(x단계 ;
if(단계>=lth-1){
단계 =0
}
}else{
단계--
if(step<=0){
step = lth-1;
}
}
first = x
document.querySelectorAll('#tobj img')[step ].style.display = 'block'
}
})
window.addEventListener('touchend',function(e){
e.preventDefault();
step = step;
})
核心精简
if(Math.abs(x - first)>10){
document.querySelectorAll('#tobj img')[step].style.display = 'none'
if(x< 먼저){
단계 ;
if(step>=lth-1){
단계 =0
}
}else{
단계--
if(단계단계 = l번째-1;
}
}
첫 번째 = x;
document.querySelectorAll('#tobj img')[step].style.display = '차단'
}