如何让这个滚动更慢?

时间:2017-09-27 18:13:50

标签: javascript jquery

我需要在这个页面中使这个滚动更慢并且在不同的浏览器和计算机(特别是鼠标滚轮和移动设备)中工作:https://www.ley257caba.com/,它似乎滚动得太快了。我想在滚动条的插件jquery中我可以更改deltaFactor值并且行为会改变,但是我找不到适用于所有浏览器的特定值,我的(谷歌Chrome,Yosemite)工作正常但在其他计算机中,它的行为有所不同,是否有默认值或我可以做些什么来解决这个问题或至少让它更自然?

这里是jquery代码:

    /* 
----------------------------------------
DEFAULT OPTIONS 
----------------------------------------
*/

    defaults={
        /*
        set element/content width/height programmatically 
        values: boolean, pixels, percentage 
            option                      default
            -------------------------------------
            setWidth                    false
            setHeight                   false
        */
        /*
        set the initial css top property of content  
        values: string (e.g. "-100px", "10%" etc.)
        */
        setTop:0,
        /*
        set the initial css left property of content  
        values: string (e.g. "-100px", "10%" etc.)
        */
        setLeft:0,
        /* 
        scrollbar axis (vertical and/or horizontal scrollbars) 
        values (string): "y", "x", "yx"
        */
        axis:"y",
        /*
        position of scrollbar relative to content  
        values (string): "inside", "outside" ("outside" requires elements with position:relative)
        */
        scrollbarPosition:"inside",
        /*
        scrolling inertia
        values: integer (milliseconds)
        */

        /* 
        auto-adjust scrollbar dragger length
        values: boolean
        */
        autoDraggerLength:true,
        /*
        auto-hide scrollbar when idle 
        values: boolean
            option                      default
            -------------------------------------
            autoHideScrollbar           false
        */
        /*
        auto-expands scrollbar on mouse-over and dragging
        values: boolean
            option                      default
            -------------------------------------
            autoExpandScrollbar         false
        */
        /*
        always show scrollbar, even when there's nothing to scroll 
        values: integer (0=disable, 1=always show dragger rail and buttons, 2=always show dragger rail, dragger and buttons), boolean
        */
        alwaysShowScrollbar:0,
        /*
        scrolling always snaps to a multiple of this number in pixels
        values: integer
            option                      default
            -------------------------------------
            snapAmount                  null
        */
        /*
        when snapping, snap with this number in pixels as an offset 
        values: integer
        */
        snapOffset:0,
        /* 
        mouse-wheel scrolling
        */
        mouseWheel:{
            /* 
            enable mouse-wheel scrolling
            values: boolean
            */
            enable:true,
            /* 
            scrolling amount in pixels
            values: "auto", integer 
            */
            scrollAmount:"auto",
            /* 
            mouse-wheel scrolling axis 
            the default scrolling direction when both vertical and horizontal scrollbars are present 
            values (string): "y", "x" 
            */
            axis:"y",
            /* 
            prevent the default behaviour which automatically scrolls the parent element(s) when end of scrolling is reached 
            values: boolean
                option                      default
                -------------------------------------
                preventDefault              null
            */
            /*
            the reported mouse-wheel delta value. The number of lines (translated to pixels) one wheel notch scrolls.  
            values: "auto", integer 

            deltaFactor:"auto"
            "auto" uses the default OS/browser value 
            */

            deltaFactor:"5",



            /*
            normalize mouse-wheel delta to -1 or 1 (disables mouse-wheel acceleration) 
            values: boolean
                option                      default
                -------------------------------------
                normalizeDelta              null
            */
            /*
            invert mouse-wheel scrolling direction 
            values: boolean
                option                      default
                -------------------------------------
                invert                      null
            */
            /*
            the tags that disable mouse-wheel when cursor is over them
            */
            disableOver:["select","option","keygen","datalist","textarea"]
        },
        /* 
        scrollbar buttons
        */
        scrollButtons:{ 
            /*
            enable scrollbar buttons
            values: boolean
                option                      default
                -------------------------------------
                enable                      null
            */
            /*
            scrollbar buttons scrolling type 
            values (string): "stepless", "stepped"
            */
            scrollType:"stepless",
            /*
            scrolling amount in pixels
            values: "auto", integer 
            */
            scrollAmount:"auto"
            /*
            tabindex of the scrollbar buttons
            values: false, integer
                option                      default
                -------------------------------------
                tabindex                    null
            */
        },
        /* 
        keyboard scrolling
        */
        keyboard:{ 
            /*
            enable scrolling via keyboard
            values: boolean
            */
            enable:true,
            /*
            keyboard scrolling type 
            values (string): "stepless", "stepped"
            */
            scrollType:"stepless",
            /*
            scrolling amount in pixels
            values: "auto", integer 
            */
            scrollAmount:"auto"
        },
        /*
        enable content touch-swipe scrolling 
        values: boolean, integer, string (number)
        integer values define the axis-specific minimum amount required for scrolling momentum
        */
        contentTouchScroll:25,
        /*
        advanced option parameters
        */
        advanced:{
            /*
            auto-expand content horizontally (for "x" or "yx" axis) 
            values: boolean
                option                      default
                -------------------------------------
                autoExpandHorizontalScroll  null
            */
            /*
            auto-scroll to elements with focus
            */
            autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",
            /*
            auto-update scrollbars on content, element or viewport resize 
            should be true for fluid layouts/elements, adding/removing content dynamically, hiding/showing elements, content with images etc. 
            values: boolean
            */
            updateOnContentResize:true,
            /*
            auto-update scrollbars each time each image inside the element is fully loaded 
            values: boolean
            */
            updateOnImageLoad:true,
            /*
            auto-update scrollbars based on the amount and size changes of specific selectors 
            useful when you need to update the scrollbar(s) automatically, each time a type of element is added, removed or changes its size 
            values: boolean, string (e.g. "ul li" will auto-update scrollbars each time list-items inside the element are changed) 
            a value of true (boolean) will auto-update scrollbars each time any element is changed
                option                      default
                -------------------------------------
                updateOnSelectorChange      null
            */
            /*
            extra selectors that'll release scrollbar dragging upon mouseup, pointerup, touchend etc. (e.g. "selector-1, selector-2")
                option                      default
                -------------------------------------
                releaseDraggableSelectors   null
            */
            /*
            auto-update timeout 
            values: integer (milliseconds)
            */
            autoUpdateTimeout:60
        },
        /* 
        scrollbar theme 
        values: string (see CSS/plugin URI for a list of ready-to-use themes)
        */
        theme:"light",
        /*
        user defined callback functions
        */
        callbacks:{
            /*
            Available callbacks: 
                callback                    default
                -------------------------------------
                onInit                      null
                onScrollStart               null
                onScroll                    null
                onTotalScroll               null
                onTotalScrollBack           null
                whileScrolling              null
                onOverflowY                 null
                onOverflowX                 null
                onOverflowYNone             null
                onOverflowXNone             null
                onImageLoad                 null
                onSelectorChange            null
                onUpdate                    null
            */
            onTotalScrollOffset:0,
            onTotalScrollBackOffset:0,
            alwaysTriggerOffsets:true
        }
        /*
        add scrollbar(s) on all elements matching the current selector, now and in the future 
        values: boolean, string 
        string values: "on" (enable), "once" (disable after first invocation), "off" (disable)
        liveSelector values: string (selector)
            option                      default
            -------------------------------------
            live                        false
            liveSelector                null
        */
    },





/* 

0 个答案:

没有答案