Debt Consolidation - Gavin Newsom - Wp themes - Debt Consolidation - WoW Gold

PDA

View Full Version : Could I have some help please. Regarding Javacript.


RazorianFly
Apr 13th 2007, 8:42 am
Hello, i'm new here, I just sourced this link as I have a problem.
Here is the script (resolution redirection):

<HEAD>

<script type="text/javascript">
<!-- Begin

var thiswidth=screen.width;
var thisheight=screen.height;

// file to load if resolution is 640x480:
var if640x480 ="";

// file to load if resolution is 800x600:
var if800x600="";

// file to load if resolution is 1024x768:
var if1024x768="";

// file to load if resolution is 1152x864:
var if1152x864="";

// file to load if resolution is 1280x720:
var if1280x720="";

// file to load if resolution is greater than 1280x720:
var Redirect ="";

// Do not change anything below this line
// --------------------------------------
var width1 = 640; var height1 = 480;
var width2 = 800; var height2 = 600;
var width3 = 1024; var height3 = 768;
var width4 = 1152; var height4 = 864;
var width5 = 1280; var height5 = 720;

if (screen.width == width1 || screen.height == height1){
location=(if640x480);}
else if(screen.width == width2 || screen.height == height2){
location=(if800x600);}
else if(screen.width == width3 || screen.height == height3){
location=(if1024x768);}
else if(screen.width == width4 || screen.height == height4){
location=(if1152x864);}
else if(screen.width == width5 || screen.height == height5){
location=(if1280x720);}
else if(screen.width >= width5 || screen.height >= height5){
alert(msg);
}
//-->
</script>

I'm trying to encorporate a 5 second delay into this script. Does anyone have any idea what line of code needs to go in, and where?

Thanks for the help in advance,
R-Fly

NetMidWest
Apr 13th 2007, 9:12 am
<script type="text/javascript">
<!-- Begin
function delay(){

var thiswidth=screen.width;
var thisheight=screen.height;

// file to load if resolution is 640x480:
var if640x480 ="";

// file to load if resolution is 800x600:
var if800x600="";

// file to load if resolution is 1024x768:
var if1024x768="";

// file to load if resolution is 1152x864:
var if1152x864="";

// file to load if resolution is 1280x720:
var if1280x720="";

// file to load if resolution is greater than 1280x720:
var Redirect ="";

// Do not change anything below this line
// --------------------------------------
var width1 = 640; var height1 = 480;
var width2 = 800; var height2 = 600;
var width3 = 1024; var height3 = 768;
var width4 = 1152; var height4 = 864;
var width5 = 1280; var height5 = 720;

if (screen.width == width1 || screen.height == height1){
location=(if640x480);}
else if(screen.width == width2 || screen.height == height2){
location=(if800x600);}
else if(screen.width == width3 || screen.height == height3){
location=(if1024x768);}
else if(screen.width == width4 || screen.height == height4){
location=(if1152x864);}
else if(screen.width == width5 || screen.height == height5){
location=(if1280x720);}
else if(screen.width >= width5 || screen.height >= height5){
alert(msg);
}

}

//-->
</script>

</head>
<body onLoad="setTimeout('delay()', 5000)">

The bolded text is what I have added...
BTW, be sure to fill in the locations like this:
var if640x480 ="../whatever.html";

Oh yeah, welcome to the forums... :)

RazorianFly
Apr 13th 2007, 9:16 am
Thanks for the welcome, oh ... and the help :)

Cheers :gr8:
R-Fly