87,989
社区成员
发帖
与我相关
我的任务
分享
var timer
$(document).scroll(function () {
clearTimeout(timer)
timer = setTimeout(function () {
var t = $(document).scrollTop();
console.log(t)
if (t >= 50) {
$(".topbar").animate({ height: "50px" }, 400);
}
else {
$(".topbar").animate({ height: "30px" }, 400);
}
}, 100);
});