View Single Post
  #4 (permalink)  
Old May 13th, 2006, 16:23
darryladie darryladie is offline
Up'n'Coming Member
Join Date: Mar 2006
Location: East Sussex, UK
Age: 20
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Resolution specific delivery

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)

Last edited by darryladie; May 13th, 2006 at 16:26.
Reply With Quote