I have a side menu on my site that i would like always visible.
To accomplish this, I am using the following code sample from this page:
http://camwebdesign.com/
Demo
http://jsfiddle.net/NsfwM/
fullscreen http://jsfiddle.net/NsfwM/embedded/result/
JS
var $scrollingDiv = $("#scrollingDiv");
$(window).scroll(function(){
var y = $(this).scrollTop(),
maxY = $('#footer').offset().top,
scrollHeight = $scrollingDiv.height();
if(y< maxY-scrollHeight ){
$scrollingDiv
.stop()
.animate({"marginTop": ($(window).scrollTop()) + "px"}, "slow" );
}
});
And another with your 30px offset in place http://jsfiddle.net/NsfwM/1/