How do you make it so certain images or pieces of code get loaded after everythign else? So that it loads everything essential, and then loads some background images...
| SitePoint Sponsor |

How do you make it so certain images or pieces of code get loaded after everythign else? So that it loads everything essential, and then loads some background images...





You really cannot. Not with server-side languages at least -- they're completely independent of the order in which things load on a given page. You can influence the order in which a page loads however. For instance, if you separate your page into tables (e.g. header table, main content table, footer table), it will tend to load from top to bottom. Additionally, text and such things often times load much more quickly than images. However, it ultimately depends on the browser and the connection speed. Not the language used.
-Colin
Colin Anderson
Ambition is a poor excuse for those without
sense enough to be lazy.
You could use a combination of CSS and JavaScript to do this. Use the style attribute to change the 'visibility' property to hide the object until such time as you wish for the user to see it. Then use JavaScript to make it visible.
PHP Code:<table id='table' style='visibility: hidden'>
</table>
<script>
function Show()
{
document.getElementById('table').style.visibility = 'visible';
}
</script>
Bookmarks