Skip to content

Lag on Scroll  #21

@Hitking

Description

@Hitking

Hi

I'm using the theia-sticky-sidebar script for fixing two sidebar on left and right of the container. the problem is, people which using old computers (PC with 3 or older age) figure out with very bad lag. specially laptop users has this problem. to get this fixed. I tried to add a timer on the scroll call function

// Initialize the sidebar's position.
o.onScroll(o);

        // Recalculate the sidebar's position on every scroll and resize.
        var timer;
        $(document).scroll(function() {
            if(timer) {
                window.clearTimeout(timer);
            }

            timer = window.setTimeout(function(o) {
                return function () {
                    o.onScroll(o);
                };
            }(o), 10);
        });

It's much better now but the side bar reach to the position with delay which make it unsuitable. Please help me to fixed this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions