javascript - Auto scaling DIV element and taking into account header and footer until scroll -
The height of the slashpage: 100%
I am trying to create a splash page But the footer and header positions are not fixed keeping in mind the size and footer size, but the footer will be sticky when the footer reaches the top: 0; As long as I try to get a splash screen to work on many devices, all sounds good, I have tried the queries of CSS media but I believe that the first time I really need javascript to monitor change in height. Note: I have taken a look but do not mention the possibility of scrolling.
HTML:
& lt; Nav class = "top-menu" & gt; & Lt; Ul & gt; & Lt; Li & gt; Top button 1 & lt; / Li & gt; & Lt; Li & gt; Top button 2 & lt; / Li & gt; & Lt; Li & gt; Top button 3 & lt; / Li & gt; & Lt; Ul & gt; & Lt; / Div & gt; & Lt; Div class = "splashpage" & gt; & Lt; / Div & gt; & Lt; Nav class = "down-menu" & gt; & Lt; Ul & gt; & Lt; Li & gt; Button 1 below & lt; / Li & gt; & Lt; Li & gt; Button 2 below & lt; / Li & gt; & Lt; Li & gt; Button 3 below & lt; / Li & gt; & Lt; Ul & gt; & Lt; / Div & gt; & Lt; Div square = "page of the rest" & gt; & Lt; / Div & gt;
css
.top-menu {width: 100%; Height: 40px;} Button-menu {width: 100%; Height: 40px;} .splashpage {height: 100%} height: 100%;}. The rest of the page {width: 100%;}
should fix the splash page except the top and bottom bar, then users can scroll down and see the rest of the page. Below is an image to show me what I mean.
In fact, I'm setting the splash page to 100% height and positioning the top menu at the top of the page and bottom menu on the bottom. I'm checking the padding above the slash page div for the height of the menu.
* {box size: border-box; } Html, body {height: 100%; Margin: 0; Padding: 0; } Ul {list-style: none; Margin: 0; Padding: 0; } Li {Display: Inline; } .top-menu, .bottom-menu {width: 100%; Height: 40px; Status: Completed; } .top- Menu {background: blue; Top: 0; } .bottom-menu {background: green; Bottom: 0; } .splashpage {height: 100%; Padding: 40px 0; } .- The rest of page {width: 100%; Minimum height: 500px; Background: yellow; }
& lt; Nav class = "top-menu" & gt; & Lt; Ul & gt; & Lt; Li & gt; Top button 1 & lt; / Li & gt; & Lt; Li & gt; Top button 2 & lt; / Li & gt; & Lt; Li & gt; Top button 3 & lt; / Li & gt; & Lt; Ul & gt; & Lt; / Neo & gt; & Lt; Div class = "splashpage" & gt; Splash page content & lt; / Div & gt; & Lt; Nav class = "down-menu" & gt; & Lt; Ul & gt; & Lt; Li & gt; Button 1 below & lt; / Li & gt; & Lt; Li & gt; Button 2 below & lt; / Li & gt; & Lt; Li & gt; Button 3 below & lt; / Li & gt; & Lt; Ul & gt; & Lt; / Neo & gt; & Lt; Div square = "page of the rest" & gt; Rest of page content
Comments
Post a Comment