Is it possible to show and hide a class based on viewport height?
I am familiar with displaying and hiding a class after a specified pixel height, but I'm wondering if it's achievable using viewport height instead? Specifically 3 times the viewport height?
For example, currently I can set a fix for 300px where a div is hidden after scrolling past that point. It reappears once the scroll value is less than 300px.
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 300) {
$('.para-hide').hide();
} else {
$('.para-hide').show();
}
However, my goal is to perform the same function but based on 300vh (3 times the viewport height).
Any recommendations on how to achieve this?