【发布时间】:2012-12-25 11:37:10
【问题描述】:
我有问题。我需要像http://community.saucony.com/kinvara3/ 这样的视差。我知道如何制作视差,但不是只用鼠标滚动一次。
从卷轴移动一次,卷轴直线运行。
【问题讨论】:
标签: jquery scroll mouse parallax
我有问题。我需要像http://community.saucony.com/kinvara3/ 这样的视差。我知道如何制作视差,但不是只用鼠标滚动一次。
从卷轴移动一次,卷轴直线运行。
【问题讨论】:
标签: jquery scroll mouse parallax
您应该在触发滚动时临时禁用滚动。
function disable_scroll() {
if (window.addEventListener) {
window.addEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = wheel;
document.onkeydown = keydown;
}
function enable_scroll() {
if (window.removeEventListener) {
window.removeEventListener('DOMMouseScroll', wheel, false);
}
window.onmousewheel = document.onmousewheel = document.onkeydown = null;
}
【讨论】: