下面的代碼通過添加/刪除一個類的名字改變了我的導航的方向。我怎樣才能使它在褪色,出來的時候,方向會發生?這裏是我的代碼:添加淡入/淡出添加/刪除
$(window).scroll(function() {
($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#prim").addClass("horizontal") : $("#prim").removeClass("horizontal");
($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#logo").addClass("small") : $("#logo").removeClass("small");
});
編輯
我已經嘗試添加.fadeIn和.fadeOut到線的上方,但它只是打破。
例子:
($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#prim").addClass.fadeIn("horizontal") : $("#prim").removeClass.fadeOut("horizontal");
[你嘗試過什麼(http://whathaveyoutried.com) ? – Eric 2013-03-23 17:15:33
@Eric查看更新後的問題 – egr103 2013-03-23 17:27:31