Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #914330

    Hello,

    I build a page with a fixed menu and logo that overlaps the bottom of the navigation line. For the beginning of every page and blog entry it’s like it should be.

    If any user scrolls down, I want to exchange this logo with another image file and straighten the bottom of the navigation line.

    Similar example, how it should work: http://gleichpersonaltraining.com/

    What can I do, to reach this?

    #914389

    Hey brandhands,

    Try adding this php code at the bottom of functions.php:

    function add_custom_script(){
    ?>
    <script>
    var $document = $(document),
        $element = $('#header'),
        className = 'hasScrolled';
    
    $document.scroll(function() {
      if ($document.scrollTop() >= 5) {
        $element.addClass(className);
      } else {
        $element.removeClass(className);
      }
    });
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    then add this css code in Quick CSS (located in Enfold > General Styling):

    #top #header.hasScrolled .logo, 
    #top #header.hasScrolled .logo a {
        height: 80px !important;
    }
    
    #top #header.hasScrolled .logo img {
        content: url('image');
        max-height: 80px;
    }

    Just replace image with the logo you posted in private content. Hope this helps :)

    Best regards,
    Nikko

    #914776

    Hello,

    thank you for the code. The effect is working, but finally the image doesn’t work.

    I have also tried ” instead of ‘ and to upload the image with a height of 80 px:

    My whole code in style.css (child folder) now is:

    div .logo {
    	left: 0px;
    	z-index: 10000;
    	top: 0px;
    	height: 150px;
    	background-color: #ff7300;
    }
    
    #top #header.hasScrolled .logo, 
    #top #header.hasScrolled .logo a {
        height: 80px !important;
    }
    
    #top #header.hasScrolled .logo img {
        content: url('http://herbon.de/soldier/wp-content/uploads/2018/02/ofpt_apfel_transp_80.png');
        max-height: 80px;
    }
    • This reply was modified 6 years, 10 months ago by brandhands.
    #914813

    Hi,

    I have checked your site and it seems to be working fine. Can you tell us how we can see the problem? what do you mean by the image doesn’t work? we’ll try to help you with it once we can reproduce it on our end.

    Best regards,
    Nikko

    #915331
    #915370

    Hi,

    I see, it’s all good in chrome but it doesn’t work on firefox, I added this css code in your Quick CSS (located in Enfold > General Styling):

    #top #header.hasScrolled .logo a {
        background-image: url(https://herbon.de/soldier/wp-content/uploads/2018/02/ofpt_apfel_transp_80.png);
        max-height: 80px;
    }
    
    #top #header.hasScrolled .logo img {
        visibility: hidden;
        opacity: 0;
        filter: alpha(opacity=0);
    }

    Let us know if this works on your end. :)

    Best regards,
    Nikko

    #915393

    Thank you. Now it works at firefox as well.

    #915398

    Hi,

    Glad that we could help. :) Let us know if you need further assistance or if we can close this thread.

    Best regards,
    Nikko

    #916694

    Hello,

    another question:

    what should I have to do, to stretch an element from container area outside to the full screen? (as the same as the background image in any fullwidth color section)

    especially I want to stretch the map in the bottom of the startpage and I want to have no space between the map and the footer.

    #916862

    Hi,

    You can do that from the settings of the section, the element can go full width.

    Best regards,
    Basilis

    #916931

    Hi. I’m trying to also get my logo to change upon scrolling but I didn’t have any luck with the code.

    #917627

    Hi jimmiesner,

    Can you try to create a separate thread? and give us temporary admin access, just post the details in private content so the details can only be seen by the moderators and the thread creator. Also please add a link to this thread on that new thread so we can use as a reference :)

    Best regards,
    Nikko

    #917947

    Thanks!

    You’ll find that info in this thread: https://kriesi.at/support/topic/want-logo-to-change-when-scrolling/

    Jim

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.