Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1340943

    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

    #1341050

    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

    #1341074

    … 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 …

    #1341265

    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

    #1341311

    Ismael – it works!
    Thank you very much – I wouldn’t have thought of that.

    #1341419

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Change logo image after scroll down’ is closed to new replies.