Floating block using JQuery
$(function() { var fixedelement = $("#left_fixed_div"); var offset = fixedelement.offset(); var topPadding = 15; $(window).scroll(function() { if ($(window).scrollTop() > offset.top) { fixedelement.stop().animate({marginTop: $(window).scrollTop() - offset.top + topPadding}); } else { fixedelement.stop().animate({marginTop: 0}); };}); });