I am using jQuery user interface tabs. How can I prevent the flickering of content loading and also make sure the content is displayed when javascript is disabled?
I tried to add the .js class to the body when the document is loaded, but since the tabs load at the same time as the added class, the content still flickers.
#container{display:none;}
<div id="container">
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
</ul>
<div id="tabs-1">
<p>Tab 1</p>
</div>
<div id="tabs-2">
<p>Tab 2</p>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#tabs').tabs();
$('#container').show();
});
</script>
source
share