Javascript Code:Forward user to resolution specific page ,Detect Window Screen Resolution

Detect Window Screen Resolution

Some times viewer of our sites have diffrent resolution due to this resion sites designed in  higher or lower resolution does not look as they have designed .So there is only solution for this problem is either user changes there resolution or you redirect then to diffrent version of your site that suites to there resolution here i am giving the code that wiil redirect user to according to condition. 

function CheckResolution()
{
if(screen.width<1180 || screen.height<924)
{
location.href('http://google.com');
}
else if (screen.width<800 || screen.height<600)
{
location.href('http://youtube.com');
}
else
{
location.href('http://yahoo.com');
}

}

put the above code between head section.

<head>Code here</head>

and call the CheckResolution function on the body on load.

<body onLoad="CheckResolution();">
Tags: , ,

Join Us!