OK, to redirect the user based on their resolution do the following:
- Code: Select all
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
if (winW<768) {
document.write('<META HTTP-EQUIV=Refresh CONTENT="1; URL=index2.htm>')
}
If you load index1.htm first, then if the user needs it the browser will redirect to the new page (index2.htm). Hope this helps (and works - I havent tested it)
