Last active
June 27, 2018 07:16
-
-
Save vuonglam94/f859c4b860376f8e9243151f5915a1dd to your computer and use it in GitHub Desktop.
[JQuery] Set div background = height of window screen
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
$(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