$(document).ready(function(){
var obj = $('#sticky');
var offset = obj.offset();
var topOffset = offset.top;
var marginTop = obj.css("marginTop");
$(window).scroll(function() {
var scrollTop = $(window).scrollTop();
if (scrollTop >= topOffset){
obj.css({
marginTop: 90,
position: 'fixed',
});
}
if (scrollTop < topOffset){
obj.css({
marginTop: 20,
position: 'relative',
});
}
});
});