CSS/Jquery固定头&x2B;改变
我想做这个 请注意,当您向下滚动时,标题是如何保持固定的,但也会发生一些变化。我该怎么做CSS/Jquery固定头&x2B;改变,jquery,css,header,scroll,fixed,Jquery,Css,Header,Scroll,Fixed,我想做这个 请注意,当您向下滚动时,标题是如何保持固定的,但也会发生一些变化。我该怎么做 我知道如何使用CSS,但希望在页眉中添加更多样式。只需查看页面来源: $(window).scroll(function(){ if ( $('div.wrapper').width() >= 660 ) { if ( $(this).scrollTop() > pos.top+header.height() && header.hasClass('def
我知道如何使用CSS,但希望在页眉中添加更多样式。只需查看页面来源:
$(window).scroll(function(){
if ( $('div.wrapper').width() >= 660 ) {
if ( $(this).scrollTop() > pos.top+header.height() && header.hasClass('default') ) {
header.fadeOut('fast', function(){
$(this).removeClass('default').addClass('scrolling').fadeIn('fast');
});
} else if ( $(this).scrollTop() <= pos.top+header.height() && header.hasClass('scrolling') ) {
header.fadeOut('fast', function(){
$(this).removeClass('scrolling').addClass('default').fadeIn('fast');
});
}
}
});
$(窗口)。滚动(函数(){
如果($('div.wrapper').width()>=660){
if($(this.scrollTop()>pos.top+header.height()&&header.hasClass('default')){
header.fadeOut('fast',function(){
$(this).removeClass('default').addClass('scrolling').fadeIn('fast');
});
}else if($(this).scrollTop()只需查看页面的源代码:
$(window).scroll(function(){
if ( $('div.wrapper').width() >= 660 ) {
if ( $(this).scrollTop() > pos.top+header.height() && header.hasClass('default') ) {
header.fadeOut('fast', function(){
$(this).removeClass('default').addClass('scrolling').fadeIn('fast');
});
} else if ( $(this).scrollTop() <= pos.top+header.height() && header.hasClass('scrolling') ) {
header.fadeOut('fast', function(){
$(this).removeClass('scrolling').addClass('default').fadeIn('fast');
});
}
}
});
$(窗口)。滚动(函数(){
如果($('div.wrapper').width()>=660){
if($(this.scrollTop()>pos.top+header.height()&&header.hasClass('default')){
header.fadeOut('fast',function(){
$(this).removeClass('default').addClass('scrolling').fadeIn('fast');
});
}else if($(this).scrollTop()