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

Flash of Unstyled Content (FOUC) on Tabs #130

Closed neilgee closed 7 years ago

neilgee commented 7 years ago

Am getting a flash of unstyled content (fouc) on the list items on the main list nav any pointers on getting around this. - Example - http://saltuary.com.au/prices/

jellekralt commented 7 years ago

There is no 'built-in' solution to prevent this. The classes are put on the tabs with javascript, so if there is any (heavy) js running before the responsive tabs js, you can indeed have FOUC. You could solve it by initially hiding the tabs by adding a class, and after loading, removing that class.

neilgee commented 7 years ago

cool thanks...

CSS

.hidetabs  {
    display: none;
}

JS

jQuery(function( $ ){
     $('#tabs1').removeClass('hidetabs');

         $('#tabs1').responsiveTabs({
         startCollapsed: 'accordion',
         // Add other parameters
         });
});