-
AuthorPosts
-
July 27, 2015 at 8:30 am #341805
Good afternoon,
We are using a href to put link tabs to other tabs. It works correctly, save for one niggle. Instead of scrolling to the very top of the tabs container, it scrolls in line with the tab heading, meaning that visitors to the site have to scroll up manually in order to read the text in its entirety. Is it possible to make it scroll to the top of the tabs box?
Many thanks. Love the theme, by the way!
July 27, 2015 at 8:33 am #341809This reply has been marked as private.July 27, 2015 at 8:51 am #341824Hi there,
Please add the following code in Customize -> Custom -> JavaScript :
jQuery( function($) { $(document).on('click', '.x-accordion-toggle, .x-nav-tabs .x-nav-tabs-item a', function( e ){ $('html, body').stop(); }); });
Hope it helps.
July 27, 2015 at 9:16 am #341846Hi there,
Thanks for the prompt reply. Unfortunately, the issue persists, as the JS only affects when the tabs themselves are clicked.
What we’re looking for is for the page to scroll up to the top of the tabs container when the links housed within the tab’s text area are clicked (“Click here to start”, “Next: Financial Planning etc.”).
Many thanks!
July 27, 2015 at 10:48 am #341931Hi there,
Thanks for writing in! That could technically be possible with custom development. While that is outside the scope of support, I could point you in the right direction with the understanding that it would ultimately be your responsibility to take it from here.
So, you can try using this JS code instead under Custom > JavaScript in the Customizer:
jQuery(document).ready(function($) { $('.enable_jump_to').on('click touchstart', function(e) { e.preventDefault(); var el = $(this).closest('.x-tab-content').prev('.x-nav'); var adminbarHeight = $('#wpadminbar').outerHeight(); var navbarFixedTopHeight = $('.x-navbar-fixed-top-active .x-navbar').outerHeight(); $('html, body').animate({ scrollTop: el.offset().top - $('.x-navbar-fixed-top-active .x-navbar').outerHeight() - $('#wpadminbar').outerHeight() - 10 }, 500); }); });
Thanks!
July 27, 2015 at 6:26 pm #342299Hi there,
That’s perfect, does the job magnificently. Top notch support. Many thanks!
July 28, 2015 at 12:11 am #342485You’re welcome.
Cheers!
X -
AuthorPosts