Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

Updating the position of element in DOM over scroll is delayed when smooth scrolling is enabled

  • 2 trả lời
  • 1 gặp vấn đề này
  • 21 lượt xem
  • Trả lời mới nhất được viết bởi pragav94

more options

I am trying to add a SVG element next to the form labels with absolute position. When there is a scroll I am listening to scroll event and updating the position of the SVG. When smooth scrolling is enabled the SVG tends to bounce over continuous scrolling. This bouncing is observed in macOS Chrome and in FireFox when smooth scrolling is enabled.

In Linux/Windows, this can be reproduced by using smooth scroll smooth scroll chrome extension.

I've captured the bouncing due to scroll in this recording

bounce due to scroll

I am trying to add a SVG element next to the form labels with absolute position. When there is a scroll I am listening to scroll event and updating the position of the SVG. When smooth scrolling is enabled the SVG tends to bounce over continuous scrolling. This bouncing is observed in macOS Chrome and in FireFox when smooth scrolling is enabled. In Linux/Windows, this can be reproduced by using [https://chrome.google.com/webstore/detail/smoothscroll/nbokbjkabcmbfdlbddjidfmibcpneigj smooth scroll] smooth scroll chrome extension. I've captured the bouncing due to scroll in this recording [[bounce due to scroll|bounce due to scroll]]

Tất cả các câu trả lời (2)

more options

Link to jsfiddle Link to jsfiddle

more options

pragav94 said

I am trying to add a SVG element next to the form labels with absolute position. When there is a scroll I am listening to scroll event and updating the position of the SVG. When smooth scrolling is enabled the SVG tends to bounce over continuous scrolling. This bouncing is observed in macOS Chrome and in FireFox when smooth scrolling is enabled. In Linux/Windows, this can be reproduced by using smooth scroll smooth scroll chrome extension. I've captured the bouncing due to scroll in this recording Screen Recording Link to jsfiddle Link to jsfiddle