-
AuthorPosts
-
November 16, 2015 at 12:31 pm #536443
Seems like my previous thread will not be answered anymore, so i’ll repost it.
https://kriesi.at/support/topic/link-to-tab-in-navbar-scrolls-down-the-page/Hello
First of al I would like to say I really love the theme and it’s a pleasure to work with.
However I am having some difficulties with links to a tab.I’ll try to explain a little bit better.
I have a page called “about us” and this page displays 3 tabs using the “tabs content element”
“Profile” “Recommendation” and “Competences”.If I navigate towards “about us” the first tab wil display just fine. However I want to add an option in the menubar to directly navigate to the second and third tab.
I added those in the menu with a custom link
http://www.agtp.org/about-us/ for “Profile”
http://www.agtp.org/about-us/#tab-id-2 for “Recommendation”
and http://www.agtp.org/about-us/#tab-id-3 for “Competences”.The first one works just fine. The second and third don’t.
When i click the link i get navigated to the right tab but the page scrolls down a bit automatically.
So the top half of the page is not visible and you have to scroll up to start at the top of the page.It happens when I deactivate all plugins as well.
I hope I have explained this in a way you can understand the problem.
If not you can have my login info to see for yourself.With kind regards,
DaanNovember 18, 2015 at 10:02 am #537921Hey Bespokedesign!
Thank you for using Enfold.
Please try this in the functions.php file:
// ava_custom_scroll add_action('wp_footer', 'ava_custom_scroll'); function ava_custom_scroll(){ ?> <script> (function($){ $('#top .av-main-nav .sub-menu a[href*="tab-id"]').on('click', function() { var tab = $('#top .tabcontainer').offset(); $('body').animate({ scrollTop: tab.top / 2 }, 2000); }); })(jQuery); </script> <?php }
Go the about page then click the menu items.
Best regards,
IsmaelNovember 29, 2015 at 6:10 am #544064Sorry it’s still not working how it’s supposed to.
December 3, 2015 at 2:09 am #546196Hi!
Alright. Please remove the modification then modify the js >shortcodes.js file. Look for this code around line 2672:
scoll_target = el_offset - 50 - parseInt($('html').css('margin-top'),10);
.. replace it with:
scoll_target = el_offset - 150 - parseInt($('html').css('margin-top'),10);
Best regards,
IsmaelDecember 4, 2015 at 1:34 am #546783sorry, this also didn’t fix the issue.
December 29, 2015 at 8:50 pm #558225guys?
December 29, 2015 at 10:03 pm #558240Hey!
can you please add the second code and we can see the page live?
Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.