我使用ScrollMagic库制作了动画,我也在使用GSAP。这是逐步滚动动画的描述。每个数字都是一卷:
因此,这与鼠标在mousewheel事件上的效果很好。问题是:
当用户来自iOS或Andorid时,实现具有相同效果的触摸滚动的最佳方法是什么? (当用户从android,iPhone,iPad等访问我的网站时)
我知道有touchmove事件。
var image = document.getElementById('image-phone');
if(step == 1){
//do first step
}...
//mousewheel event
window.addEventListener('mousewheel', function (e) {
//this is implemented
});
//touchnmove event
window.addEventListener('touchmove', function (e) {
//should I use this event
});