How to create a sticky footer that reveals on scroll - Theme Prestige

Highlighted
Tourist
9 0 0

Hello guys !

As mentioned in the title, I am looking for a way to implement a sticky footer that reveals when I scroll. I am on shopify and I use the prestige theme.
To give you a visual exemple of what I am looking for, here is a link of a site that has exactly what I want:
https://www.chanel.com/en_WW/fashion.html

Thank you all in advance !

Fouc

 

 

0 Likes
Highlighted

Hi there,
Jack from OpenThinking here!

Here's the code to achieve a "footer that reveals on scroll":

CSS:

main {
  /* make sure to cover the screen */
  min-height: 100vh;

  /* need a solid bg to hide the footer */
  background: white;

  /* put it on top */
  position: relative;
  z-index: 1;

  padding: 2rem;
}

footer {
  /* place on the bottom */
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #252a47;
  display: grid;
  place-items: center;
  padding: 50px; /* depends on the height of your footer content */
}

here's a working demo: https://jsfiddle.net/fhLwbyox/ 


let me know if this works for your. If yes; accept my answer and give me thumbs up! Thank you.

⚡️ [Shopify Themes]: Lightning-fast, Highly converting, SEO-optimized, Minimal.
⚡️ Need help with your store? [Get a quote]
Highlighted
Tourist
9 0 0

Hi Jack, thanks for your answer, unfortunately it didn't do it for me, I just added those lines, but it only added padding to the sides of my pages.

Thank you

0 Likes
Highlighted

try this

main { position: relative; z-index: 9; background-color: white; }
#section-footer { position: sticky; bottom: 0; z-index: 1; }

 

⚡️ [Shopify Themes]: Lightning-fast, Highly converting, SEO-optimized, Minimal.
⚡️ Need help with your store? [Get a quote]
0 Likes
Highlighted
Tourist
9 0 0

Well it doesn't work, annoying cause when I read the lines of code you've provide me, they seem to make perfectly sense, but I don't know why I doesn't have the required effect

0 Likes
Highlighted

You've to put the code inside your theme.scss.liquid file (or whatever it is called in your theme) at the very bottom. 

⚡️ [Shopify Themes]: Lightning-fast, Highly converting, SEO-optimized, Minimal.
⚡️ Need help with your store? [Get a quote]
0 Likes
Highlighted
Tourist
9 0 0

I did, i did but it doesn't work

0 Likes
Highlighted

That's strange!

Try putting !important at the end like so;

main { position: relative!important; z-index: 9!important; background-color: white!important; }
#section-footer { position: sticky!important; bottom: 0!important; z-index: 1!important; }

 

⚡️ [Shopify Themes]: Lightning-fast, Highly converting, SEO-optimized, Minimal.
⚡️ Need help with your store? [Get a quote]
0 Likes
Highlighted
Tourist
9 0 0

Ok, after way to much time I think I finally got it, I ended up with this, seems to work

body {
  padding-bottom: 240px!important;
  background: white;
}
main{
  min-height:100vh!important;
  background: white;
  z-index:1;
}
#section-footer {
  position:fixed;
  bottom:0;
  left:0;
  width:100%;
  height:230px;
  background: white;
  z-index:-1;
}
0 Likes