3
I’m making a Landing page that has a footer between sections, and when the user scrolls to that footer it should stay fixed at the bottom.
I tried to use scrollToFixed but it behaves like a header, fixed to the top.
Has how to change this plugin or simpler way to do?
ul{
border-bottom: 1px solid #ccc;
}
ul li{
display: inline-block;
padding: 10px
}
section{
background: #ccc;
padding: 20px 10px;
}
.footer-contato{
background: #f1f1f1;
}
<header>
<nav>
<ul>
<li>home</li>
<li>informações</li>
<li>localização</li>
<li>patrocinadores</li>
</ul>
</nav>
</header>
<section class="home">
<h1>Home</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</section>
<section class="informacoes">
<h1>Informações</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</section>
<section class="footer-contato">
<h1> Footer fixed </h1>
</section>
<section class="local">
<h1>Local</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</section>
<section class="patrocinadores">
<h1>Patrocinadores</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</section>
Footer’s place is in the middle ? Then when the user gets to Footer, he should go there in the Bottom ?
– Diego Souza
Here’s an example I did: http://jsfiddle.net/ckvda5L3/ ... it has to do with this or I got it wrong ?
– Diego Souza
it should be fixed at the bottom only when it appears to the user, during the @Deesouza scroll
– fronthendy
Haaa. I get it... I’ll see if I can simulate.
– Diego Souza
And when it rises it has to return in the place ?
– Diego Souza
Yes, back to place with relative position
– fronthendy