Created
February 6, 2017 14:42
-
-
Save nerdyrasa/a57dad840e0fbe8d5648a661b542e29d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // https://css-tricks.com/forums/topic/setting-a-div-height-to-the-window-viewport-size/ | |
| $(document).ready(function(){ | |
| resizeDiv(); | |
| }); | |
| window.onresize = function(event) { | |
| resizeDiv(); | |
| } | |
| function resizeDiv() { | |
| vpw = $(window).width(); | |
| vph = $(window).height(); | |
| $(‘#somediv’).css({‘height’: vph + ‘px’}); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment