2

Everything is working smoothly on Chrome, but on IE 9 the green element is jumping on scroll, why?

Here is a JSFiddle link.

body{
    height:1000px;
}

.block{
    width:50px;
    height:20px;
    background: green;
}
CubeJockey
  • 2,209
  • 8
  • 24
  • 31
  • I believe this is a limitation in IE. I used code to perform the same effect which was smooth in chrome, but in IE jumpped. – Craig Smith Dec 31 '14 at 08:02
  • [Check the answers here](http://stackoverflow.com/questions/19377810/windows-8-makes-fixed-backgrounds-jump-when-scrolling-with-mouse-wheel). Smooth scrolling when disabled does make a bit of a difference. – anpsmn Dec 31 '14 at 08:27

1 Answers1

0

It's occurring in chrome too if you move scrollbar faster.

Please consider using fixed position instead of setting css top everytime scroll event is occurred because when scroll event is occurred,The scroll's already moved and a page get rerendered according to new scroll position.what you are doing is to change how it looks right after the page get rerendered.

in addition, scroll event/resize event would potentially be called dozens of times per second.So those kind of code easily causes a performance issue.

suish
  • 3,253
  • 1
  • 15
  • 34