I saw a cool style/js function (I can tell what it is) that implemented on a side menu.
You know the situation when you have a long center page and one of / both of you sides ends and that leave a blank space? Well this site implemented this thing that just when the user scrool to the place where the side menu end – the menu get absolute postion and doesnt move.
How can I do this?
If you want to see an example you can look here (just scroll and look on the sides)
I believe you can achieve similar effect using this: http://www.wduffy.co.uk/blog/keep-element-in-view-while-scrolling-using-jquery/comment-page-1/ (just making it move with
0as speed parameter instead ofslow, as in the example) and adding conditions about whether the current position fits within the box it is displayed (you can take height of the box – menu being moved on page or box that contains the menu – by using .height() jQuery function).EDIT:
The page you referenced uses the following JavaScript code to support what you try to accomplish:
And the
make-fixedCSS class has the following definition: