Throw the tabs inside a section, give the section an id, ie tabsection1, add a smooth scroll to the section and specify the id (#tabsection1) as the position, then when the tab is clicked it should remain static… Not a js fix but gets the job done until you get a better answer @mebeingken
Think Ken maybe busy for a moment Teodor so hope he doesn't mind me answering for him in the interim... By default they scroll back to the top of the page.
@Teodor put me back on track. This had nothing to do with tab clicks, it had to do with the differences in the tab content height. When moving from a “long tab” to a “short tab” the page length would adjust and appear to be a scroll.
I modified a nice script that maintains the height by setting all the tab panes within a tab group to the longest tab:
var maxHeight = 0;
$("#tabContent1 > .tab-pane").each(function(){
if ($(this).height() > maxHeight) {
maxHeight = $(this).height();
}
});
$("#tabContent1 > .tab-pane").height(maxHeight);
Glad it helped Marcel. I’m still perfecting the script to deal with multiple groups of tabs to make it clean in all situations. I’m experimenting right now with adding a page buffer to the bottom so I don’t get any gaps with stacking in mobile.
But for a single tab group, the script shown works.