Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$(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
You can’t perform that action at this time.