Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我希望我的页面只滚动一次,以便连续多次滚动。下面是我的代码?_Javascript_Jquery_Mousewheel - Fatal编程技术网

Javascript 我希望我的页面只滚动一次,以便连续多次滚动。下面是我的代码?

Javascript 我希望我的页面只滚动一次,以便连续多次滚动。下面是我的代码?,javascript,jquery,mousewheel,Javascript,Jquery,Mousewheel,我希望我的页面只滚动一次,以便连续多次滚动。下面是我的代码 当我说少了一个零件时: 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(ev

我希望我的页面只滚动一次,以便连续多次滚动。下面是我的代码


当我说少了一个零件时:

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

最后一行是代码正常时缺少的部分

请提供一个工作示例,使用html,例如使用JSFIDLE。我使用mouseweel.js进行水平滚动这是我的完整代码@verdesrobert@user3513879Plase post html代码
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