Attached title jumps on fast scrolling

I have a sticky header problem. I have a place to keep a good height when I scroll and it works fine. The problem occurs when I scroll faster. I read that the jquery scroll position is 1-2-4-12 .. pixels at once, and across it my sticky heading title is not in position, I wanted something like jumping or blinking.

scroll() {
  let queryWindow = Ember.$(window);
  let siteBarHeight = Ember.$('.folded').offset() ? 19 : 47;

  queryWindow.scroll(() => {
    let fixedHeader = this.get('fixedHeader');
    let shouldBeFixed = queryWindow.scrollTop() > 90 + siteBarHeight;

    if (!fixedHeader && shouldBeFixed) {
      this.set('fixedHeader', true);
    } else if (fixedHeader && !shouldBeFixed) {
      this.set('fixedHeader', false);
    }
  });
}

      

This all works fine when my scrolling is slow, but otherwise jquery is sticking to it too late. Thanks in advance for your help, tell me if you need more information on this.

+3


source to share





All Articles