WeCodePixels / theia-sticky-sidebar

Glues your website's sidebars, making them permanently visible while scrolling.
MIT License
569 stars 209 forks source link

Lag on Scroll #21

Open Hitking opened 8 years ago

Hitking commented 8 years ago

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.

liviucmg commented 7 years ago

@Hitking There are some performance improvements bundled in the latest version (1.5.0). Can you please try it out and let me know how it goes?

KingKingov commented 7 years ago

The same problem on my three-column site