Header Logo Change on Scroll

3 replies · opened Jul 1, 2020

77Lexen7Jul 1, 2020

Hi there,

I wanted no logo to appear in the header until I scroll down. In order to accomplish I created a transparent logo as a place holder for the regular logo...
I then used data-sticky-logo to set the regular logo...

It is now performing the way I would like...
But I imagine there is a more elegant way to accomplish this... Is there?
In short, I would like NO logo on page load... But as soon as I scroll I would like the logo to appear...

Here is the code I used to accomplish what I wanted.

<!-- Logo
============================================= -->
<div id="logo">
<a
href="index.html"
class="standard-logo"
data-dark-logo="ca-img/carrier-advisors-logo-clear.png"
data-sticky-logo="ca-img/carrier-advisors-logo.png"
>
attachment

<a
href="index.html"
class="retina-logo"
data-dark-logo="ca-img/carrier-advisors-logo-clear@2.png"
data-sticky-logo="ca-img/carrier-advisors-logo@2.png"
>
attachment

</div>
<!-- #logo end -->

You can see this live here
https://www.carrieradvisors.info/about-us.html

Thank you for your help!!!!!

SSemicolon WebSTAFFJul 1, 2020

Hello,

You can try something like this:


#logo {
	opacity: 0;
}

#header.sticky-header #logo {
	opacity: 1;
}

This should definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

77Lexen7Jul 2, 2020

That would go in custom css correct?

And that would apply to all pages?

Looking for a way for just specific pages...

SSemicolon WebSTAFFJul 2, 2020

Hello,

Yes, you will need to add this in the css/custom.css File to apply this on all the Page.

However, if you would like to apply this only to Custom Specific, create another CSS File and add this code, then link it in the Document `` on these pages.

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard