Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Function to automatically set the height of #home-hero-content to viewport height.
- function home_hero_height() {
- var barHeight = $('#wpadminbar').outerHeight();
- var windowHeight = window.innerHeight;
- var newHeight = windowHeight - barHeight;
- $( '#home-hero-content' ).css({'height': newHeight + 'px'});
- }
- // http://stackoverflow.com/a/1974797/778809
- // Bind to the resize event of the window object
- $(window).on("resize", function () {
- home_hero_height();
- // Invoke the resize event immediately
- }).resize();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement