jellekralt / Responsive-Tabs

Responsive Tabs is a jQuery plugin that provides responsive tab functionality. The tabs transform to an accordion when it reaches a CSS breakpoint. You can use this plugin as a solution for displaying tabs elegantly on desktop, tablet and mobile.
http://jellekralt.github.io/Responsive-Tabs/
MIT License
531 stars 228 forks source link

Scroll to Tab on Mobile with SetHash set to True #81

Closed katart closed 8 years ago

katart commented 8 years ago

I think it would be a good idea to add in a default option where the page would scroll to the active Tab on mobile device.

If I open (or activate) a new accordion item that is below an already opened, long accordion item, the new active item will move up outside of the viewport. It would be nice to have the window scroll up with the accordion item.

Can this be done now with the tab-active callback? If so, can you explain how that can be done?

Thanks

jellekralt commented 8 years ago

This is actually an already existing option! You can enable the auto scrolling with the scrollToAccordion option: https://github.com/jellekralt/Responsive-Tabs#scroll-to-accordion-panel

katart commented 8 years ago

That's great! I must have overlooked that option.