Last active
December 8, 2022 02:18
-
-
Save IgorGavrilenko/554219fe45cc35e64483d73019dd20c1 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
jQuery(window).scroll(function() { | |
// проверка на докрутку до определенного элемента | |
var scroll_picca =jQuery('.scroll_picca').offset().top; | |
console.log(scroll_picca) ;// выводим в консоль смещение элемента пицца | |
//если мы докрутили до нужного элемента | |
if (jQuery(this).scrollTop() > scroll_picca) { | |
// создаем эффекты и анимацию | |
jQuery(".bottom_float_menu").show(); | |
}else{ | |
jQuery(".bottom_float_menu").hide(); | |
} | |
// если докрутил до низа страницы | |
if(jQuery(window).scrollTop()+jQuery(window).height()>=jQuery(document).height()){ | |
jQuery(".bottom_float_menu").hide(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment