Everything is working smoothly on Chrome, but on IE 9 the green element is jumping on scroll, why?
body{
height:1000px;
}
.block{
width:50px;
height:20px;
background: green;
}
Everything is working smoothly on Chrome, but on IE 9 the green element is jumping on scroll, why?
body{
height:1000px;
}
.block{
width:50px;
height:20px;
background: green;
}
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.