How can I make this function run on load and on window resize?
thanks.
jQuery(function( $ ) {
var headerHeight = $("#header").outerHeight();
var viewportHeight = $(window).height();
var elementNewHeight = viewportHeight - headerHeight;
$(".fullHeightThis").outerHeight(elementNewHeight);
});
jQuery(function( $ ) {
function someStuff(){
var headerHeight = $("#header").outerHeight();
var viewportHeight = $(window).height();
var elementNewHeight = viewportHeight - headerHeight;
$(".fullHeightThis").outerHeight(elementNewHeight);
}
someStuff(); //call immediately
$(window).on('resize', someStuff);
});