I would like to on pure CSS, jQuery has a solution.

  • one
    Can you add an example or jQuery solution? What is what you need is different from the usual basement at the end of the page? - Gleb Kemarsky pm
  • one
    Yes Easy. And what's the problem? - Qwertiy
  • @Gleb Kemarsky here is an almost complete jQuery solution. In my case, there should be a block with a basement. The necessary option differs in that the basement as it leaves the page with a full scrolling. - JackDone 4:34 pm
  • @Qwerity The problem is that I don’t know how to do it in CSS and I’m interested to know how to do it. I would be grateful if you show how. - JackDone
  • In CSS, do not intercept the current window scroll. Exactly how is the element visible in the viewport at the moment. Right on JS to do - why sculpt crutches. - Goncharov Alexander

1 answer 1

How to show the basement only if the page is scrolled to the end?

body { font-family: Tahoma; font-size: 1em; line-height: 2em; } main, footer { display: block; } .container { max-width: 500px; width: 100%; margin: 2rem auto; } footer { background: #333; padding: 1rem; text-align: center; color: #fff; opacity: 0; animation: show 1s 1s ease-in-out both; } @-webkit-keyframes show { from { opacity: 0;} to { opacity: 1; } } @keyframes show { from { opacity: 0;} to { opacity: 1; } } 
  <div class="container"> <main> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. In, eum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A sint aliquam molestiae facilis nobis nostrum eveniet tempora, harum tenetur magni recusandae aut minus nemo odio, quas, soluta neque doloribus aliquid. Illum quam, nisi? Excepturi ut nobis necessitatibus illum suscipit esse officia nostrum animi asperiores autem nam iusto debitis unde delectus exercitationem soluta nisi provident quos, quas dolorum. Praesentium quibusdam maiores aliquid eius, voluptatem iusto deleniti illo. Iure officia fuga ratione nisi, neque, doloremque explicabo quibusdam laudantium nihil fugit! Commodi perspiciatis ratione porro aut, nobis pariatur consectetur eius id. Laborum impedit illum et cupiditate quas reiciendis laboriosam excepturi itaque culpa necessitatibus.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. In, eum.</p> </main> <footer> &copy 2016 </footer> </div> 

If only css is the only way).

Events scroll + positioning (top point / bottom point of the window) have not yet come up with css alas.

Alternatively, you can make a block (not visible) in front of the footer or use the last paragraph that would cause the footer to appear on, but this is if the user moves the mouse over this block and does not just scroll.