I have this jQuery code. How to do the same thing but using pure JavaScript? I want to detect if the scrollbar is visible.
$(document).ready(function() {
// Check if body height is higher than window height :)
if ($("body").height() > $(window).height()) {
alert("Vertical Scrollbar! D:");
}
});
I had tried to do this way and it didn't work
if(document.body.height > window.height){
alert("Vertical Scrollbar! D:");
}