html,body{
height:1500px;
}
#div{
margin-top:200px;
padding:30px;
background:#ee0;
border-radius:4px;
}
.back{
position:fixed;
top:0; left:0;
margin-top: 0 !important;
width:100%;
background-color:#cc0 !important;
}
$(window).scroll(function() {
body = $(window).scrollTop();
if(body > 200){
$("#div").addClass('back');
}else{
$("#div").removeClass('back');
}
});