-
AuthorPosts
-
October 21, 2015 at 12:58 pm #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.
October 21, 2015 at 5:12 pm #522382Anyone?
October 21, 2015 at 5:44 pm #522399Hi!
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,
DakeOctober 21, 2015 at 5:53 pm #522401Hi 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
October 21, 2015 at 6:02 pm #522412Just 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.
October 21, 2015 at 7:28 pm #522450Hey!
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,
DakeOctober 22, 2015 at 10:27 am #522821Okay, 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
JohnOctober 23, 2015 at 12:06 am #523384Hey!
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,
JosueOctober 23, 2015 at 10:41 am #523585Many thanks for your efforts Josue. Unfortunately it’s not fixed the issue. Reverted back to original.
October 23, 2015 at 10:49 pm #524142Hi,
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,
JosueOctober 26, 2015 at 11:31 am #524796Thanks 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
JonOctober 26, 2015 at 11:55 pm #525237Hi!
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,
JosueOctober 27, 2015 at 11:25 am #525418I’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.
October 27, 2015 at 11:51 pm #525848Sure, let us know how it goes.
October 30, 2015 at 3:30 pm #527474Hi,
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.
October 30, 2015 at 10:24 pm #527721Glad to help :)
Regards,
Josue -
AuthorPosts
- The topic ‘#Links and sticky menus’ is closed to new replies.