Change Logo When Scroll Down (Travus Theme) - Question | JoomShaper

Change Logo When Scroll Down (Travus Theme)

R

Remco

Template 4 years ago

Hi,

I use the Travus theme. At the top left is the logo with pay-off. I would like the pay-off to disappear when scrolling down. So the full logo in the normal header and another logo in the sticky header. Who can help me? See also the examples.

0
11 Answers
Rashida Rahman
Rashida Rahman
Accepted Answer
Support Agent 4 years ago #18321

Hi Remco,

You may try the following code in your custom CSS to get two different logo either:

#sp-header.header-sticky .logo img { opacity: 0; }
#sp-header.header-sticky .logo a { background-image: url(/helixultimate_quickstart_j3_v1.1.1/images/pattran.png); background-repeat: no-repeat; background-size: contain; }

Please use your desired image URL what you want to see in sticky mode while scrolling. You have to keep it within the media.

Note: Path towards custom CSS: Extensions>Templates>Styles> Click on your current default template name then choose Template Options. Then find custom CSS within the custom code.

https://prnt.sc/pu705g

https://prnt.sc/pu70zn

Best Regards

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 4 years ago #18050

Hello Remco

Your screenshot and site view does not match. Please follow the CSS given in the next comment.

Best regards

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #18052

Hi there,

Thanks for contacting us. Please add this css code inside the custom.css file.

#sp-header.header-sticky .logo img {
    height: 50px;
    width: 290px;
}

-Thanks

0
R
Remco
Accepted Answer
4 years ago #18060

Hi Ofi Khan and Toufiq,

I've edited the screenshots to show you how I want it. It is true that they do not correspond to what the website looks like now, because otherwise my question would not be necessary because it is already the way I want it.

So in concrete terms, how can I make my website look like the previously sent screenshots? In any case, I need two different logos. The full logo in the normal header and the logo without pay-off in the sticky header when you scroll down. But how can i do this? That was my question.

Regards, Remco

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #18067

Sorry to say that, this is not possible that you want to do exactly. Thanks

0
R
Remco
Accepted Answer
4 years ago #18076

Is there really no way to do this at all? Is it not possible to show a different logo in the sticky header by a custom CSS adjustment?

0
Toufiq
Toufiq
Accepted Answer
Senior Staff 4 years ago #18228

Sorry to say that, this feature does not exist. Thanks

0
Pavel
Pavel
Accepted Answer
4 years ago #18236

Hi Remco. It is very easy to do by using Joomla Custom module and a small CSS coding.

The starting point for this:

You can publish Custom module containing another logo in the Logo position. Then, using CSS you need to hide this module in the state before scrolling and display in the state after scrolling. And hide main Logo in the state after scrolling.

Parent classes that you can use:

/*Before scroll*/
#sp-header .some_kind_of_child_class {
    /* your code goes here */
}
/*After scroll*/
#sp-header.header-sticky .some_kind_of_child_class {
    /* your code goes here */
}

With this you can change anything inside Header before and after scrolling.

Or you can use JavaScript to change the value in the src attribute of .logo-image after scrolling.

0
R
Remco
Accepted Answer
4 years ago #18315

Thanks Pavel,

Since I am not a programmer, and only have basic html and css knowledge .. Could you maybe and want to help me with the css and the javascript?

I would really appreciate that!

Regards, Remco

0
R
Remco
Accepted Answer
4 years ago #18330

Thank you, that helps me! Solved with the following CSS:

/*Before scroll*/
#sp-header.header-sticky .logo img {
    opacity: 0;
}

/*After scroll*/
#sp-header.header-sticky .logo a {
    background-image: url(www.moventa.nl/site/images/logo-moventa-travel.svg);
    background-repeat: no-repeat;
    background-size: contain;
    margin-top: 0px;
    height: 60px !important;
}

#sp-header.header-sticky .logo img {
  height: 60px !important;
}
0
Rashida Rahman
Rashida Rahman
Accepted Answer
Support Agent 4 years ago #18338

Hi Remco,

Really glad that it helped:)

And you are always welcome...

0