wduffy / jScroll

jScroll is a jQuery plugin that keeps an element in view when a user scrolls.
http://www.wduffy.co.uk/jScroll
73 stars 19 forks source link

Performance, CSS only solution? #4

Open ffranke opened 13 years ago

ffranke commented 13 years ago

Hi there,

thanks for the plugin.

Do you thin its possible to solve the positioning via css only (The performance should be better, when the margin is not calculated on each scroll).

The idea is, to assign to the element the style "position:fixed" after a certain offset. In this case, the browser manages the positioning of the element. To "stop" the element before a footer for example, it could be set to position:absolute with top: theCurrentOffsetFromTop.

What do you think of that and do you can help me a little bit with that?

Thanks! florian

ChaseFlorell commented 12 years ago

I fully agree with this, unfortunately my JS chops aren't strong enough to accomplish it.

I've got a Bing Map wrapped in a DIV and set to .jscroll, but the thing is jerky as hell when I scroll. When I just fix the div with css, the scrolling is perfect. Problem is that it's not a viable solution long term. This plugin has potential to solve all the jerkiness.