Created
August 6, 2020 21:12
-
-
Save RuslanAsadov/77fcd172aeb6fdfe44e362a61d780983 to your computer and use it in GitHub Desktop.
small content JS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const contentHeight = | |
$('header')[0].offsetHeight + | |
$('main')[0].offsetHeight + | |
$('footer')[0].offsetHeight | |
if ($(window).height() > contentHeight) { | |
const toAdd = $(window).height() - contentHeight | |
const height = $('main')[0].offsetHeight + toAdd | |
$('main').css('height', height + 'px') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment