Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

157
Views
Problem with scrolling in chrome on windows

I used jquery.sticky and jquery.scrollbar I tried scroll sticky block in parallel scroll window. This code is worked, but have some bags in chrome and Edge on windows. (there isn't on ubuntu). When sticky block is scrolling event scroll of window is triggered once. It seems that the scrolling is slow. When the sticky block is in the end position event scroll of window is triggered several. If I comment out lines "$('.content__sidebar').scrollTop(total_scrolled);" the slow scrolling will disappear. Sticky block have some child with jqury.scrollbar. I tried disable jquery.scrollbar but problem remained. Why event scroll of window is triggered once, when sticky block is scrolling?

$('.content__sidebar').sticky({topSpacing:155, bottomSpacing: 310});
$(window).scroll(function(e){
    var scrollTop = $(window).scrollTop();//+10;
    direction = scrollTop-scrollTop_prev;

    console.log({scrollTop:scrollTop,scrollTop_prev:scrollTop_prev,direction:direction,total_scrolled:total_scrolled});
    if (direction_prev>0 && direction<0) { 
        //console.log("revert");
        //total_scrolled = $('.content__sidebar').scrollTop();
    } else if (direction>0) { 
        //console.log("down");
        total_scrolled += direction;
        $('.content__sidebar').scrollTop(total_scrolled);
    } else {
        total_scrolled += direction;
        $('.content__sidebar').scrollTop(total_scrolled);
    }
    if (total_scrolled>$('.content__sidebar').scrollTop()) {
        total_scrolled = $('.content__sidebar').scrollTop();
    }
    if (total_scrolled<0) {
        total_scrolled = 0;
    }
    scrollTop_prev = scrollTop;
    direction_prev = direction;

});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!