Prevent Tabby Tabs FOUC
-
Hi.
Whenever I load a page that’s using Tabby Tabs, there is a second or so where the page loads the content *without* displaying the tabs. Then, after a second, the Tabby Tabs plugin loads and the content is shown in the proper tabs.Is there a way of preventing this Flash of Unstyled Content (FOUC) when using Tabby Tabs?
Basically, a way to only load the content in the tabs *after* the plugin is ready and loaded?
Here’s what I found on this topic:
add_action('wp_head', 'fouc_protect_against'); /** * Combat FOUC in WordPress * @link https://stackoverflow.com/questions/3221561/eliminate-flash-of-unstyled-content */ function fouc_protect_against () { ?> <style type="text/css"> .hidden {display:none;} </style> <script type="text/javascript"> jQuery('html').addClass('hidden'); jQuery(document).ready(function($) { $('html').removeClass('hidden'); }); </script> <?php }
Could this be adapted to work with Tabby Tabs?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Prevent Tabby Tabs FOUC’ is closed to new replies.