Skip to content

Instantly share code, notes, and snippets.

@vuonglam94
Last active June 27, 2018 07:16
Show Gist options
  • Save vuonglam94/f859c4b860376f8e9243151f5915a1dd to your computer and use it in GitHub Desktop.
Save vuonglam94/f859c4b860376f8e9243151f5915a1dd to your computer and use it in GitHub Desktop.
[JQuery] Set div background = height of window screen
$(function(){
$(window).resize(function() { // resize window event
var screen_height = $(window).height(); // get window height
$('.test').css({'height': screen_height}); // set height of div class="test"
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment