JQuery: $(window).resize() doesn't work on Load

Posted by Nicki on Stack Overflow See other posts from Stack Overflow or by Nicki
Published on 2010-04-08T02:17:27Z Indexed on 2010/04/08 2:23 UTC
Read the original article Hit count: 301

I noticed that the following JQuery code doesn't run on the page load, but instead, it only runs after the page loads and I change the size of my browser window.

$(window).resize(function() {
  ... // dynamically set the height of some div based on the browser viewpoint height
});

Question: How do I get the code above to also run when the page loads?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript