ScrollToFixed icon indicating copy to clipboard operation
ScrollToFixed copied to clipboard

Scrolling inside target block

Open andreyvolokitin opened this issue 10 years ago • 3 comments

If target block has overflow: auto and has overflowing content inside, then this actually happens when we scroll that content inside target (from source):

target.bind('scroll.ScrollToFixed', function() {
    target.trigger('preUnfixed.ScrollToFixed');
    setUnfixed();
    target.trigger('unfixed.ScrollToFixed');
    checkScroll();
});

It causes problems with scroll inside target in many browsers and it is actually seems wrong - to unfix target, then checkScroll(), then probably fix target again if it was fixed, while we actually do not need it - we just scroll target contents, not window. I am wondering why we need this event handler for scroll on target? I understand that it was put there for a reason, but at the moment I can not quite understand what would it mean for the rest of the plugin if this event handler will be removed. Does it just handle some edge cases, or is it needed in some specific scenarios?

andreyvolokitin avatar Dec 01 '14 20:12 andreyvolokitin

Related: https://github.com/bigspotteddog/ScrollToFixed/issues/102

andreyvolokitin avatar Dec 01 '14 20:12 andreyvolokitin

Related commits:

  • https://github.com/bigspotteddog/ScrollToFixed/commit/d5bec17d6f1a0b07047d781f26f3ace159ba750e#diff-754eaca39c9d503247b45dd204948fca
  • https://github.com/bigspotteddog/ScrollToFixed/commit/ee15bc3830d861d503fd934c2a7c42325c5cee72#diff-754eaca39c9d503247b45dd204948fca

andreyvolokitin avatar Dec 01 '14 20:12 andreyvolokitin

same problem implementing inside overflow content with position absolute.

buste avatar May 18 '15 08:05 buste