Under 1024 of width I'd like body of the page to fit the screen of a user without a scrollbar. Basically, I want to scale whole body so that it fits screen browser(without scrollbar) under 1024 width. I tried something like this:
function resizeWindow() {
$(window).off('scroll');
windowWidth = $(window).width();
console.log(windowWidth);
if (windowWidth > 1024)
{
console.log(">1024");
}else if (windowWidth <= 1024)
{
$('body').css('height', '100vh');
$('body').css('width', '100vw')
}
}
$(window).resize(resizeWindow);
CSS:
body, html {
height: 100%;
width: 100%;
}