i want my page to scroll only once for for continuous multiple scrolls. below is my code?
if(w > 1300) {
$('.scroll-pane').bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(event, delta) {
if(event.originalEvent.wheelDelta /120 > 0 ) {
val =this.scrollRight + (delta *433 * 2 );
jQuery(this).animate({
scrollRight: val
}, 500,'easeOutSine');
event.preventDefault();
$(this).text('scrolling up !');
}
else {
val = this.scrollLeft - (delta * 433 * 2 );
jQuery(this).stop().animate({
scrollLeft: val
}, 500,'easeOutSine');
event.preventDefault();
}
clearTimeout(scrollTimeout);
});
最佳答案
当我说缺少一部分时:
var w=1500;//this value is added by me, you should post the part that provides this variable's value.
if(w > 1300) {
$('.scroll-pane').bind('mousewheel DOMMouseScroll MozMousePixelScroll', function(event, delta) {
if(event.originalEvent.wheelDelta /120 > 0 ) {
val =this.scrollRight + (delta *433 * 2 );
jQuery(this).animate({
scrollRight: val
}, 500,'easeOutSine');
event.preventDefault();
$(this).text('scrolling up !');
}
else {
val = this.scrollLeft - (delta * 433 * 2 );
jQuery(this).stop().animate({
scrollLeft: val
}, 500,'easeOutSine');
event.preventDefault();
}
clearTimeout(scrollTimeout);
});
} //this was missing in the original
最后一行是代码没问题的地方
关于javascript - 我希望我的页面仅滚动一次以连续多次滚动。下面是我的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22955555/