Click to See Complete Forum and Search --> : Pre Load Help
I need help. I've tried many different script but none seem to do what I want them to. I want all the images on my page to pre-load and I don't want the user to see the page while they are loading. So it will just keep them at a blank white page while the images are loading and then when there all done it will load the page and it would just all pop up because the images were pre-loaded! Can anybody help me out here? Thanks. :)
Well, I wouldn't recommend doing this, as you page will simply not display for 13% of the users, but something like this should preload the page. Also, I personally would rather be able to at least read the text while the images are loading...
<html>
<head>
<script language="javascript" type="text/javascript">
function loadPage() {
document.getElementById("beforeloaded").style.display = "none";
document.getElementById("afterloaded").style.display = "block";
}
</script>
</head>
<body onload="loadPage();">
<div id="beforeloaded" style="display:block;">Please wait while the page is loading</div>
<div id="afterloaded" style="display:none;"><iframe src="http://www.yahoo.com"></iframe></div>
</body>
</html>
Is there something I could add that would just ignore it for non-javascript users. It would just load it normally for non-javascript users, but it would do the script for users with javascript! Also what is this part for in the script you already gave me:
<iframe src="http://www.yahoo.com"></iframe>
I understand the part where it says "Page Loading.." but what is the iframe part for?
I tryed some stuff but nothing is working? I need help figuring out how to do what I asked in my post before this one!
The <iframe> was just to give it something to load, so you saw the loading message. Just place your code inside the <div id="afterloaded" style="display:none;"> div...
Also, I can't think of any simple ways to get this to show up for non-javascript users, and still work well for those with javascript... Best of to just let the page load as normal, I'd say...