내가 필요한 것
문제
스크롤 페이지의 마지막에 추가 클래스.
위의 300px 클래스를 추가해야합니다.
jsfiddle: http://jsfiddle.net/8PkQN/1/
나는 시도했다 : (window.innerHeight + window.scrollY) == $ (document) .height ()
암호
var bottom = $(document).height() - $(window).height();
if($(window).scrollTop() + 1 >= bottom - 2200==true)
{
$(".abslouel_left12").addClass("fixed_left_btm");
}
작업 코드
window.onscroll = function(ev) {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
$(".abslouel_left12").addClass("fixed_left_btm");
}
};
$(window).scroll(function() {
$(this).scrollTop() > 75 &&
($(".abslouel_left12").addClass("fixed_left"),
$('[data-toggle="tooltip"]').tooltip()),
$(this).scrollTop() < 75 && ($(".abslouel_left12").removeClass("fixed_left"),
)
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
$(".abslouel_left12").removeClass("fixed_left");
}
사용자가 맨 위에있는 경우 1입니다. 추가 할 클래스가 없습니다.
이것은 항상 나를 위해 일했습니다.
if (window.pageYOffset == $(document).height() - $(window).height()) {
// bottom of page
}
바닥 글 위에 도달했는지 알고 싶다면 계산에 바닥 글 높이를 추가 할 수 있습니다.
if ($(window).scrollTop() >= $(document).height() - $(window).height() - $('footer').height()) {
// top of footer
}
바이올린 : http://jsfiddle.net/8PkQN/449/
바닥 글 맨 위에 도달하면 경고가 발생합니다. 그게 당신이 찾고있는 것입니까?
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다