即时通讯使用slideUp功能上下滑动广告屏蔽消息,但是当您看到广告屏蔽提醒后,向下滚动后,导航栏需要一秒才能调整到顶部。它为整个过程提供了一辆越野车的外观 - 这种改变应该是即时和完美的。Jquery Slideup Function显示一个错误
,你可以在这里看到一个例子:https://www.mallyear.com/search?q=phone
使用的效果基本show函数的代码林是这样的:
jQuery(window).on("scroll", function(){
// adblocker is the Id for the ad message
// t3-header is the Id for the Nav bar
var startY = 1;
if(jQuery(window).scrollTop() > startY){
jQuery('#adblocker').slideUp("fast");
jQuery('#t3-header').css({position: 'fixed', top: '0px'});
}else{
jQuery('#adblocker').slideDown("fast");
jQuery('#t3-header').css({position: 'static', top: '80px'});
}
});
看到这Adblock的通知,需要一个扩展,如“广告拦截加上”在谷歌浏览器上,你应该运行它。该错误显示当滚动下来一秒钟,但在那里。非常感谢您的帮助
在附注中,您只需要将位置更改为静态,顶部值不需要更改,并且在元素为静态时不会应用 – Huangism