3d 逐偵圖片素材
javascript 部分程式碼
🎜>
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(xstep
if(step>=lth-1){
step =0
}
}else{
step--
if(stepstep = 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){
step =0
}
}else{
step--
if(stepstep = lth-1;
}
}
第一個= x;
document.querySelectorAll('#tobj img')[step].style.display = 'block '
}