0
我有一個固定的導航,我正在改變徽標的大小在155px滾動高度和改變李的位置。一切都很完美,但是當我回滾時它不會重置。我需要爲此做出更大的功能嗎?任何建議表示歡迎,感謝:)如何在滾動備份時重置scrollTop()div定位?
這裏是jQuery的:
$(document).scroll(function(){
if ($(this).scrollTop()>155){
$('.logo-nav').stop().animate({ height: 70 },20);
} else {
$(".menu li").addClass("nav-scroll");
$('.logo-nav').stop().animate({ height: 145 },20);
}
});
這裏的CSS:
li {
display: inline-block;
margin: 0;
position: relative;
top: 45px;
-webkit-transition: all .4s ease;
-moz-transition: all .4s ease;
-o-transition: all .4s ease;
transition: all .4s ease;
}
.nav-scroll {
top: auto;
}
我嘗試過,但它仍然沒有重置,我錯過了什麼? – jgb
@jgb你能向我們展示一個工作小提琴,這樣我們可以玩嗎? –
這裏是現在的網站:http://toddtalbot.staging.wpengine.com/ – jgb