Click to See Complete Forum and Search --> : javascript - I need Help !, how to add a delay?


mikegraphik
03-22-2003, 03:14 PM
Hello

i have created two pages one for high res and other for low resolutions, and i want to create a "splash" page that will show some content while redirect the user to the correct resolution main page.
This is the code i´m using to redirects the user to the correct res page. what i need is to add a delay of X seconds so the user can see the content of "splash" page before being redirected.How can i do this?

<script>
<!--
if (screen.width<=640)
top.location.href="index640.html";
if (screen.width<=800)
top.location.href="index800.html";
if (screen.width<=1024)
top.location.href="index1024.html";
top.location.href="index1280.html";
//-->
</script>



Thank you.

mikegraphik
03-22-2003, 04:38 PM
Thank you Dave!!!

It works perfectly unfortunately i forgot to add the 1152 resolution and i´ve tried to "rewrite" the code to acomodate these new version but it doesn´t work!
Can you please take a look?


<!--//
var url = "";
if (screen.width <= 640) {
url = "lowres.html";
} else {
if (screen.width <= 800) {
url = "lowres.html";
} else {
if (screen.width <= 1024) {
url = "lowres.html";
} else {
if (screen.width <= 1152) {
url = "lowres.html";
} else {
url = "highres.html";
}
]
}
}
window.setTimeout("top.location.href='"+url+"'", 10000);
//-->


Thank you for your time and effort.
Best Regards,
Mike

mikegraphik
03-22-2003, 04:41 PM
ahh what a shame!!!!

Thank you!

Mike