Created
July 1, 2014 18:10
-
-
Save nathanaelphilip/4eab44d15f8d22e8c227 to your computer and use it in GitHub Desktop.
Resize Height
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
var headerHeight = $('#primary-navigation').outerHeight(); | |
var footerHeight = $('#main-footer').outerHeight(); | |
var $jsheight = $('.js-height'); | |
if ($jsheight.data('sub')) { | |
$jsheight.height($(window).height() - headerHeight - $($jsheight.data('sub')).outerHeight() * 2.2); | |
}else{ | |
$jsheight.height($(window).height() - headerHeight); | |
} | |
$(window).on('resize',function(){ | |
headerHeight = $('#primary-navigation').outerHeight(); | |
footerHeight = $('#main-footer').outerHeight(); | |
$('.js-height').height($(window).height() - headerHeight); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment