<div id="startchange"></div>
$(document).ready(function(){
var scroll_start = 0;
var startchange = $('#startchange');
var offset = startchange.offset();
if (startchange.length){
$(document).scroll(function() {
scroll_start = $(this).scrollTop();
if(scroll_start > offset.top) {
$("#cat-menu").css({position:'fixed',top:'0px'});
} else {
$('#cat-menu').css({position:'fixed',top:'46px'});
}
});
}
});
No comments:
Post a Comment