I dynamically create multiple tabs using jQuery UI tabs - the tabs are created using the foreachon the browse page as follows (some code markup):
<script type="text/javascript">
$(function($) {
$('#plants').tabs('paging', { follow: true } );
});
</script>
<div id="plants">
<ul>
<?php foreach ($plants as $row):
echo '<li><a href="#tabs-'.$row->plant_id.'">'.$row->plant_name.'</a></li>';
endforeach; ?>
</ul>
<?php if (!empty($plants)):
foreach ($plants as $row): ?>
<div class="block" id="tabs-<?php echo $row->pet_id; ?>">
<div class="grid_6">
<p>
<?php echo '<h1>'.$row->pet_name.'</h1>'; ?>
etc...
</p>
</div>
</div>
<?php
endforeach;
else:
endif; ?>
</div>
As above, the tabs are fine. The problem is that this is a good idea for Flash Out of Unstyled Content. This happens in IE, Chrome, FF.
I tried the CSS parameter in the jQuery documentation, didn't work.
There's a simple JS out there that inserts the CSS style into <head>and then applies {display:none}to a specific one id, but that makes my panels fade, waiting for user interaction. I need the first panel, which will be visible to the user when loading, as well as other tabs on top - without a rough FOUC.
- , FOUC jQuery? , , , , .
/ !