Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1300989
    RLav
    Participant

    Hmm,

    something got stripped out of my reply …

    it should read: on the 2 external pages the menu has links like http://partnersinperspectief.nl/#home ….

    don’t know why this happened!

    Richard

    #1301174
    Rad
    Moderator

    Hi there,

    I lost tracking of the issues, would it be okay if we clarify what’s left? Would you mind providing a video recording of the issues? I checked the code and I’m not sure what I’m looking for.

    Thanks!

    #1301552
    RLav
    Participant

    Rad,

    I don’t have screenrecording software, so I’ll just explain.

    The problem is that on an ipad / portrait (or browser with width < 979), when you go to:

    http://partnersinperspectief.nl/missie/ or http://partnersinperspectief.nl/het-wiel-van-perspectief/

    the menu items ‘home’,’wat’, ‘wie’ and ‘waar’ will take you back to the onepage page, but there’s on offset to the section you should land on. This offset is the same height as the header (that’s scrolled out of view of course).

    My guess is that something happens within the x theme js (not my custom script) upon page load that creates this offset.

    The second (less of a) problem is that for example when you navigate to the ‘wie’ section and refresh the page, there’s a different offset. Like I said this is not a big problem, but I think the 2 are related. So when we find a solution for the first one, this will give me a clue for the second one as well.

    Richard

    #1302173
    Rad
    Moderator

    Hi there,

    Ah, it’s because one page navigation isn’t made to work that way. Scroll spy and one page is only applicable for current page, but we can trigger them on page load. Like this,

    jQuery( function($) {
    
    $(document).ready ( function() {
    
    var hash = window.location.hash;
    
    var linkItem = $(window).width() > 979 ? $( '.x-navbar .desktop .x-nav > li > a[href="' + hash + '"]' ) : $( '.x-navbar .mobile .x-nav > li > a[href="' + hash + '"]' );
    
    linkItem.trigger('click').trigger('click');
    
    } );
    
    } );

    Instead of re-creating entire functionality, we can just trigger the scroll attached to the nav item and let is scroll upon load.

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1283558 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>