Hero full browser screen image. Add #hero to img. enqueue script in functions.php
jQuery(document).ready(function($){
// Defining a function to set size for #hero
function fullscreen(){
jQuery('#hero').css({
width: jQuery(window).width(),
height: jQuery(window).height()
});
}
fullscreen();
// Run the function in case of window resize
jQuery(window).resize(function() {
fullscreen();
});
});
//Enqueue
add_action( 'wp_enqueue_scripts', 'jmg_enqueue_all' );
function jmg_enqueue_all() {
wp_register_script( 'hero', get_stylesheet_directory_uri().'/js/hero.js');
wp_enqueue_script('hero', get_template_directory_uri().'/js/hero.js', array('jquery'), false, true);
}