Q:

Floating div on scroll WITH START&END POINT (!)

what I want on my site is a div that follows when you scroll, well, this is not so difficult as there are many sites that explain how to do it. But what I could not find was how I could set a start and end position.
I want the sidebar to start to float when the top of the window touches it and I want it to stop when it is at the bottom of the container, now it floats over the footer.
Thanks.

A:

I figured it out, with jQuery I calculated the scrollTop(); and when it reached the point, for example 250px I did addClass('fixed'); to make it fixed and stay at the page.
To let it stay at the bottom at a certain point I calculated the bottom margin and when it reached the given bottom margin I did removeClass('fixed').css({position: 'absolute', bottom: '0px'}); to let it stay on the bottom of it's parent 100% height div.
I hope you understand. 

