Tagged: x
-
AuthorPosts
-
December 21, 2016 at 4:30 pm #1300989
RLavParticipantHmm,
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
December 21, 2016 at 7:05 pm #1301174
RadModeratorHi 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!
December 22, 2016 at 4:08 am #1301552
RLavParticipantRad,
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
December 22, 2016 at 6:42 pm #1302173
RadModeratorHi 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!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1283558 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
