height 100vh scrollbar code example
Example 1: what is 100vh in css
height: 100vh = 100% of the viewport height.
Example 2: change height of div with scroll in javascript
$(window).on('scroll', function () {
var scrollTop = $(window).scrollTop();
if (scrollTop > 50) {
$('#header_parent').stop().animate({height: "30px"},200);
}
else {
$('#header_parent').stop().animate({height: "50px"},200);
}
});