0
브라우저 창의 아래쪽에 도달 할 때 위로 X 링크 (바닥 글 상단)로 슬라이드 위로 이동하는 방법 즉, 사용자가 페이지를 완전히 스크롤 했습니까?브라우저 하단의 맨 위 링크, 바닥 글 위
지금 당장 내 페이지는 창 하단에 고정되어 작동하는 back-to-top 링크를 가지고 있습니다. 그러나 페이지 끝 부분에 바닥 글이 있으며 맨 아래 링크는 페이지 하단의 바닥 글 상단에 머물러 있어야합니다 (또는 뒤로 물러 설 필요가 있습니다).
상단 링크의 스크립트는 다음과 같습니다
//plugin
jQuery.fn.topLink = function(settings) {
settings = jQuery.extend({
min: 1,
fadeSpeed: 200
}, settings);
return this.each(function() {
//listen for scroll
var el = $(this);
el.hide(); //in case the user forgot
$(window).scroll(function() {
if($(window).scrollTop() >= settings.min)
{
el.fadeIn(settings.fadeSpeed);
}
else
{
el.fadeOut(settings.fadeSpeed);
}
});
});
};
//usage w/ smoothscroll
$(document).ready(function() {
//set the link
$('#top-link').topLink({
min: 400,
fadeSpeed: 500
});
//smoothscroll
$('#top-link').click(function(e) {
e.preventDefault();
$.scrollTo(0,500);
});
});