Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #522268

    Hi,
    I’m working on a site for a client. They have a product page, which is a long page with a sticky sub menu that jumps down the page to different products. These are also linked from the front page. If I click the link on the front page the sticky menu does not appear until you scroll a little bit.

    Is there any way to make sure the sub menu appears when linked from the front page? I’m guessing it could be a limitation of the feature, but I’d really appreciate some help.

    Included private links as the site isn’t launched yet.

    #522382

    Anyone?

    #522399

    Hi!

    The sub menu only appears slightly below from the front page or directly on the product page on my end.

    May I have a screenshot of what you are referring to?

    Just for future reference, we answer the oldest threads first, so new replies will send your thread to the back of our queue.

    Best regards,
    Dake

    #522401

    Hi Dake, sorry about that, didn’t know. Screen shot taken after clicking on the front page link.
    In order to display the sub menu after clicking through from the front page I have to scroll a tiny bit and it appears.
    Using Safari on a Mac – but the issue appears in Chrome and Firefox too.

    • This reply was modified 9 years, 1 month ago by jonrouse. Reason: Browser
    #522412

    Just to clarify my points, as I might not have been clear.

    1) There is a full width sub menu on the products page.
    2) It’s set to be sticky.
    3) When I click on the sub menu items, it goes to places I’ve marked with #tags on the page.
    This is good, I like it! BUT
    4) If I click the link from the front page (site.com/products/#menu_item the sticky menu isn’t there until I scroll a tiny bit.

    I would like it to display as it does in step 3 when I perform step 4.

    #522450

    Hey!

    Thank you for clarifying, I now see what you mean.

    It seems that due to the sticky trigger being on-scroll it doesn’t appear immediately when navigating to the anchor tag.

    Since this is a limitation, I’ll inform the rest of the team. However, if you’d like to resolve this urgently, you may need to enlist the aid of a freelancer to implement any required custom code.

    Regards,
    Dake

    #522821

    Okay, thanks for getting back to me. If there was only some quick css to say scroll down one pixel on clicking the anchor link or arriving on that page.

    Cheers
    John

    #523384

    Hey!

    As that something relate to behavior you’d need to modify the JavaScript of the theme, try opening js/avia.js and look for this line:

    							the_win.off('scroll.avia_first_scroll').scrollTop( scroll_to_el.offset().top - fixedMainPadding - modifier);
    

    Replace it by this:

    							the_win.off('scroll.avia_first_scroll').scrollTop( scroll_to_el.offset().top - fixedMainPadding - modifier) + 1;
    

    Modify 1 as needed.

    Best regards,
    Josue

    #523585

    Many thanks for your efforts Josue. Unfortunately it’s not fixed the issue. Reverted back to original.

    #524142

    Hi,

    Try adding this at the very end of your theme / child theme functions.php file:

    function add_custom_script(){
    ?>
    <script>
    (function($){
        $(window).load(function() {
            $(window).scroll();
        });
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    Regards,
    Josue

    #524796

    Thanks Josue,
    That’s fixed it in Safari. In Firefox it’s as it was previously, in Chrome it doesn’t go to the anchor links and just loads the product page.

    May I ask, when the theme is next updated, will I have to re-insert this code the the functions.php file?

    Cheers
    Jon

    #525237

    Hi!

    Have you checked it on another computer? i’ve been testing it on Chrome and it seems to be working fine on my end.

    Regards,
    Josue

    #525418

    I’ll try it Josue. I remember after a theme upgrade that the Avia Layout Builder wasn’t displaying and the way we got it back was to reboot the office router. Perhaps this is the same thing. I’ll get onto another machine and report back.

    Once again, thanks for your help.

    #525848

    Sure, let us know how it goes.

    #527474

    Hi,
    Just wanted to confirm it’s working in Safari, Chrome and Firefox now. Thanks so much, these forums are a gold mine to people like me who have no idea what they’re doing when it comes to CSS & JS.

    Best wishes.

    #527721

    Glad to help :)

    Regards,
    Josue

Viewing 16 posts - 1 through 16 (of 16 total)
  • The topic ‘#Links and sticky menus’ is closed to new replies.