Answers for "scroll height js"

9

get current scroll height javascript

document.documentElement.scrollTop || document.body.scrollTop
Posted by: Guest on July-24-2020
3

get current scroll height javascript

document.documentElement.scrollTop = document.body.scrollTop = 1000;
Posted by: Guest on July-24-2020
0

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);   
    }
});
Posted by: Guest on February-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language