javascript - Dynamic Footer Size With Min Size -
I have a footer (not fixed) webpage. There is currently no need to scroll the contents of the page, and at the moment 1920 × 1080, the current window atop approximately 25% on top of the screen. The contents of the footer have been aligned at the top of the footer and the rest of the footprint are empty, but with the color of the footer
It is similar to this (my page is not though): < / P>
Ideally, I want to remove the empty space in the port because the content of the page increases (instead of increasing the scrolling distance), but shrink due to reaching the least height (and then scrolling distance Begins to grow)
My question is:
- Is it possible with standard CSS?
- If not, what is possible with existing JS library (like jQuery)?
- If not, what is the best way to write a manual JS?
Thank you.
Assume that you have the following format
& lt; Div id = "content" & gt; Content that can increase & lt; / Div & gt; & Lt; Div id = "footer" & gt; Footer & lt; / Div & gt; In jQuery, you can insert a function that is added to the content every time in the content div or when the size of the window changes.
Function Fixfruit () {$ ('# footer') height ($ (window). Light () - $ ('# content'). Height ()); } Every time a change in content divas (content or page resizing) changes, call fixfuter () .
But this could mean that the height of the footer can go up to 0. Then give an example of the following style in your CSS:
#footer {min-height: 80px; }
Comments
Post a Comment