Found this nice function from Mike:
https://kriesi.at/support/topic/change-logo-when-scrolling-down/#post-1283669
That’s exactly what I need! Unfortunately it doesn’t work on my site ;-/ What ca I do?
This is my setup:
– Enfold 4882
– WordPress 5,9
– Pasted the code into my Child Theme function.php
Hey frankeee,
Thank you for the inquiry.
Did you update the image URL in the script? Look for these lines in the script and adjust the image URL.
$('.logo a').find( 'img' ).attr('src', 'https://your-full-url.com/wp-content/uploads/2021/01/2nd-logo.png').css({ 'padding-top': '0px'});
} else {
$('.logo a').find( 'img' ).attr('src', 'https://your-full-url.com/wp-content/uploads/2021/01/logofinale.svg').css({ 'padding-top': '15px'});
Please post the site URL in the private field so that we can check the modification.
Best regards,
Ismael
… thank you Ismael fpr your feedback ;-)
… according to your question: Yes I did – with some dummy images – but that doesn’t matter for the function.
Please see private content …
Hi,
Thank you for the info.
Did you set jQuery to load in your footer? The script is not working because according to the browser console “jQuery is not defined”, which means that either jQuery is actually not loaded or the script loads before the jQuery library. To fix the issue, we adjusted the priority of the wp_footer hook to 999 to make sure that the script loads after the library.
Best regards,
Ismael
Ismael – it works!
Thank you very much – I wouldn’t have thought of that.
Hi,
Glad Ismael could help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike