Created
June 7, 2017 12:52
-
-
Save anndoko/4ca8f869b07e4d0cabe7647f284712de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('scroll', function () { | |
/*===== Welcome#index - 首頁導航列變化 =====*/ | |
if ($(this).scrollTop() > 125) { | |
$('#navbar').addClass('show_bgcolor') | |
} else { | |
$('#navbar').removeClass('show_bgcolor') | |
} | |
/*===== Welcome#index - 回到頁面頂端 =====*/ | |
if ($(this).scrollTop() > 2500) { | |
$(".goTop").fadeIn(100); //按钮出现时间(画面下移) | |
} else { | |
$(".goTop").fadeOut(200); //按钮消失时间(画面上移) | |
} | |
$(".goTop").click( | |
function() { | |
$('html,body').scrollTop(0); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment