-
AuthorPosts
-
January 12, 2015 at 7:52 pm #181627
Hi,
I added both tab navs and accordions to different areas on a webpage to try them out for content options.
I set everything up properly.
When I test them as a user on the actual website, the page jumps or auto scrolls up or down when the items are clicked on.
This does not seem like natural behavior as it will scroll the information in the tabs and accordion out of sight.Needless to say, I would like the title area of the accordion to remain still and just the contents within the accordion to drop down. No movement (other than the drop down and change of tab item) when the user clicks on a tab nav or accordion.
Any ideas?
January 13, 2015 at 7:25 am #181952Hi there,
Please add the following code under Customize -> Custom -> Java Script :
jQuery(document).ready(function($) { $('.x-accordion-toggle').click(function() { var $adminbarHeight = $('#wpadminbar').outerHeight(); var $navbarHeight = $('.x-navbar').outerHeight(); var $this = $(this); setTimeout(function() { $('html, body').animate({ scrollTop: $this.offset().top - $adminbarHeight - $navbarHeight + 1 }, 400) }, 300) }); });
To fix tabs add this as well :
jQuery(function($){ $('.x-nav-tabs-item a').on('click', function(){ $('html,body').stop().animate({ scrollTop: $( $(this).attr('href') ).offset().top - $('.x-navbar').height() },700 ,'swing'); }); });
Hope it helps.
January 13, 2015 at 3:54 pm #182305Hello. Sorry to bear some bad news, I just pasted these in and I’m still having issues 🙁
https://drive.google.com/file/d/0B_RjEO4O9yNMZXhUaXF6QVU4YzQ/view?usp=sharing – I’ll try to keep this up here for a while.
January 14, 2015 at 7:01 am #182735Hi there,
Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
January 14, 2015 at 7:25 am #182757Hi, same thing happens to me with the tab nav. if you click on the tabs on the page below, it just keeps scrolling down about 50px or so
January 14, 2015 at 11:33 am #182962This reply has been marked as private.January 14, 2015 at 3:33 pm #183148any update on this?
January 14, 2015 at 3:39 pm #183152Hi NCPMR,
I tried this code and it makes the the scrolling stop.
jQuery(document).ready(function($) { $('.x-accordion-toggle, .x-nav-tabs-item a').click(function(e) { $('html, body').stop(); }); });
Or do you wish the scrolling still enabled?
@microarts, could you try this code too?
Thanks guys!
January 14, 2015 at 3:41 pm #183156yes, that works for me! thanks 🙂
January 15, 2015 at 3:43 am #183500You’re welcome!
January 16, 2015 at 2:35 pm #184685Yep thats great! Thanks, +1 for X Support 🙂
January 17, 2015 at 8:07 pm #185343You’re soo much welcome! 😉
January 19, 2015 at 7:34 pm #186492Helped me as well, thanks support team!
January 20, 2015 at 6:13 am #186804You’re welcome.
March 14, 2015 at 6:51 am #227122Hi there,
unfortunately this fix doesn’t work for me. I’m using three tabs in a tab navigation and it’s still jumping back to the top, like a #top.
I’m already using another fix for the tab navigation combined with sliders from this thread https://theme.co/x/member/forums/topic/issue-with-image-slider-in-a-2-column-tabbed-setup/#post-227114
I tried to combine the JS code but also just used this solution alone.
What else could be wrong?
-
AuthorPosts