Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save 0632347878/75007d361cb252ff54f127409f775523 to your computer and use it in GitHub Desktop.
Save 0632347878/75007d361cb252ff54f127409f775523 to your computer and use it in GitHub Desktop.
chech wieport
const $vacansies = $(".vacancies-section__holder");
let $bottom;
$(window).on('scroll', function () {
$bottom = $vacansies.offset().top + $vacansies.height();
if ($(window).scrollTop() - $bottom > 0 ) {
$('.filter-block').addClass('fixed');
} else $('.filter-block').removeClass('fixed');
});
@0632347878
Copy link
Author

//safari support

function checkView(elem) {
if (window.pageYOffset - elem.offsetTop < elem.offsetHeight/2 + 300) {
elem.classList.add('animate-scroll');
}
if (window.pageYOffset - elem.offsetTop < -elem.offsetHeight/2 - 300) {
elem.classList.remove('animate-scroll');
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment