logo
down
shadow

Set div height to window height


Set div height to window height

By : user2954740
Date : November 22 2020, 10:31 AM
this will help Removing the margin and padding will help, you can also add box-sizing: border-box; to account for borders and padding when setting widths. Also I'm not sure if you wanted to make your footer stick to the bottom of the page, but I did that along with the other fixes in this fiddle:
http://jsfiddle.net/ob1g0752/2/
code :


Share : facebook icon twitter icon
Javascript dynamic div height based on window height and second div height

Javascript dynamic div height based on window height and second div height


By : MuthuKumar s
Date : March 29 2020, 07:55 AM
With these it helps Here is the Jsfiddle
Markup like this:
code :
​<div id="main-menu"></div>
<div id="other-div">
    <h1>Sample Content</h1>
    <p>
        foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar foo bar 
    </p>
</div>​
​#other-div {
    background: #cdcdcd;
}​
$('#main-menu').height($(window).height()-$("#other-div").height());​
Add or Subtracting into $(window).scrollTop + $(window).height == $(document).height() - Scrolled to bottom of page equa

Add or Subtracting into $(window).scrollTop + $(window).height == $(document).height() - Scrolled to bottom of page equa


By : markinboone
Date : March 29 2020, 07:55 AM
I hope this helps . Use an inequality. It's quite possible the user's scrolltop is jumping right past the exact value you're comparing with.
code :
if($(window).scrollTop() + $(window).height() >= $(document).height() -300) {}
Jquery $(window).height() function does not return actual window height

Jquery $(window).height() function does not return actual window height


By : Sticken
Date : March 29 2020, 07:55 AM
will be helpful for those in need Look at your HTML souce code. The first line should be and you have