• Resolved charl1eapple

    (@charl1eapple)


    Hi Again,
    You kindly gave me a snippet to emulate the scaling/shrinking logo effect that is not included in the theme, as follows:
    .site-header.fixed-header img.logo-fullsize {
    max-width: 180px;
    }

    This works but it is jumpy, and as you start to scroll you can see both sizes and two lines of menu, which is not ideal!!

    I love Bento and would really love to pursue a way of making this scale gradually (also for another 2 Bento sites in the pipeline). Could you please look at this fiddle https://jsfiddle.net/sL89qxcx/ and let me know if I can use an adapted version of this to make it work in Bento. And if you think it would work, can you please provide the new snippet and advise if I can add the javascript using a header/footer plug in rather than tamper with the theme files which I’d rather not do.

    Thank you so much.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Theme Author satoristudio

    (@satoristudio)

    Hello Tracy,
    this is unfortunately outside the scope of the theme support offer, but you can try using something like this via a child theme to force the fixed header’s logo to shrink after scrolling 320 pixels down:

    $(document).on('scroll', function() {
      if ($(document).scrollTop() >= 320) {
        $('.site-header.fixed-header img.logo-fullsize').css('max-width', '180px');
      } else {
        $('.site-header.fixed-header img.logo-fullsize').css('max-width', '100%');
      }
    });
    Theme Author satoristudio

    (@satoristudio)

    Alternatively, you can add the code via a plugin like this one if you’re not using a child theme.

    Thread Starter charl1eapple

    (@charl1eapple)

    Thank you very much. I am an ‘expansion pack’ buyer if that makes a different to the level of support, I totally understand if this is outside of scope.

    I’m not using a child theme. So the code you’ve given me above and the ‘wp coder’ plug in, is that all I need to do – is put that code that you’ve provided above into the wp-coder’? Am I right in understanding that this will still be technically a swapping of one to the other rather than a SCALING down in size? Just want to understand before I begin! Thank you!!

    Thread Starter charl1eapple

    (@charl1eapple)

    I added this in wp-coder but it’s just the same. I added the code in the JS and got the shortcode, then put this in ‘text’ on a new test page, after trying it on other pages, it’s just the same. Is there anything else I can try? When you scroll on the page you can see both logos and two navigation bars so I’d really like to resolve this if possible. Thank you!

    Theme Author satoristudio

    (@satoristudio)

    Please try this code instead:

    $str(window).scroll( function() {
      if ($str(document).scrollTop() >= 320) {
        $str('.site-header.fixed-header img.logo-fullsize').css('max-width', '180px');
      } else {
        $str('.site-header.fixed-header img.logo-fullsize').css('max-width', '100%');
      }
    });
    Thread Starter charl1eapple

    (@charl1eapple)

    Thank you so much!!! This worked and I’ve adjusted the 320 to a lower figure so it can happen sooner!

    ONE LAST QUESTION ON THIS please? Do I need to add the wp-coder shortcode into each page individually or is there a global place I can add it so it’s applied on every page? At the moment I just put it on my ‘testing’ page within a text editor https://pantoloons.com/testing/

    Theme Author satoristudio

    (@satoristudio)

    You can try this plugin to be able to add the shortcode into the footer menu, for example ??

    Thread Starter charl1eapple

    (@charl1eapple)

    Excellent!!!!???????????? Thank you very much!!! This site complete, on with my next Bento. Thank you very much for the support.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘scaling logo on scroll’ is closed to new replies.