Forum     

Go Back   Digit Technology Discussion Forum > Portables, Peripherals and Electronics > QnA (read only)
Register FAQ Calendar Mark Forums Read

QnA (read only) Mods please help transfer the contents of this forum to proper sections. :)


 
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-03-2007, 04:24 PM   #1 (permalink)
Always Questioning?
 
emailaatif786's Avatar
 
Join Date: Feb 2006
Location: Srinagar
Posts: 354
Arrow Javascript:1024 X 768 Screen Resolution


My Webpage loads contents, images, animations, etc, correctly, only if user has 1024 X 768 or above Screen Resolution. But if user has below 1024x786 screen resolution, the page looks pretty horrible
Can anyone reply me with a javascript, that I will include with my webpage, that will redirect user to another page, if his screen resolution is below 1024 X 768 Screen Resolution, as just in the case of Yahoo! Mail Beta.
__________
Example:
Just head to https://login.yahoo.com/config/login_verify2?&.src=ym an enter your username and password > http://aa.f584.mail.yahoo.com/dc/lau...3h46eghs9tygh3

If you are having the screen resolution below 1024 X 768, you will be redirected to http://aa.f584.mail.yahoo.com/dc/sys...on=unsupported , telling you that; Seems your screen resolution is set below our minimum recommendation. When it's set under 1024 x 768 pixels, Yahoo! Mail Beta looks pretty horrible.

Please reply with the javascript, the will do this work.
__________________
:smile: Love Digit

Last edited by emailaatif786; 11-03-2007 at 04:29 PM. Reason: Automerged Doublepost
emailaatif786 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 15-03-2007, 12:15 AM   #2 (permalink)
Back to School Mr. Bean !
 
mod-the-pc's Avatar
 
Join Date: Apr 2004
Location: Chennai
Posts: 343
Default Re: Javascript:1024 X 768 Screen Resolution

This should accomplish that

Code:
 
<html>
<head>
<script language="Javascript">
function checkResolution()
{
 var minWidth=1024, minHeight=768;
 var width=screen.width;
 var height=screen.height;
 var alertMsg='';
 var lowResURL='http://www.team-mediaportal.com';
 if(width<minWidth && height<minHeight)
 {
  alertMsg+='Your current resoultion is '+width+'x'+height;
  alertMsg+='\nThis site requires a minimum resolution of '+minWidth+'x'+minHeight;
  alertMsg+='\nPlease click on OK to visit a low resolution version of this site';
  alert(alertMsg);
  window.location=lowResURL;
 }
 
}
</script>
</head>
<body onLoad="checkResolution()">
</body>
</html>
If you want it to be transparent to the users just remove the alert !
__________________
Desktop: P4 2.8E, Intel 865GBF, 512MB Hynix PC3200, Samsung SV1204H 120GB, Samsung SW-248F, Creative Inspire 4400, Samsung 793MB, Compro PVR/FM, WinLIRC

Laptop: HP Pavilion dv8210us
mod-the-pc is offline  
Old 15-03-2007, 11:41 AM   #3 (permalink)
Always Questioning?
 
emailaatif786's Avatar
 
Join Date: Feb 2006
Location: Srinagar
Posts: 354
Exclamation Re: Javascript:1024 X 768 Screen Resolution

Very Very much Thanks for replying, but I would like to change the:
var lowResURL='http://www.team-mediaportal.com';
TO:
var lowResURL='rdr\errors\scres\';
which gives me an error, Object expcted.
How to resolve this!
__________________
:smile: Love Digit
emailaatif786 is offline  
Old 15-03-2007, 03:56 PM   #4 (permalink)
Broken In
 
anilmail17's Avatar
 
Join Date: Aug 2004
Location: 127.0.0.1
Posts: 149
Default Re: Javascript:1024 X 768 Screen Resolution

Quote:
Originally Posted by emailaatif786
Very Very much Thanks for replying, but I would like to change the:
var lowResURL='http://www.team-mediaportal.com';
TO:
var lowResURL='rdr\errors\scres\';
which gives me an error, Object expcted.
How to resolve this!
the problem is this that u have used escape character. simply use this
Code:
var lowResURL='rdr/errors/scres/';
and it will work finee.
__________________
visit my blog
www.anilsoni.wordpress.com:)
anilmail17 is offline  
Old 15-03-2007, 06:47 PM   #5 (permalink)
Always Questioning?
 
emailaatif786's Avatar
 
Join Date: Feb 2006
Location: Srinagar
Posts: 354
Default Re: Javascript:1024 X 768 Screen Resolution

Quote:
Originally Posted by anilmail17
the problem is this that u have used escape character. simply use this
Code:
var lowResURL='rdr/errors/scres/';
and it will work finee.
Thankyou
__________________
:smile: Love Digit
emailaatif786 is offline  
Old 15-03-2007, 09:08 PM   #6 (permalink)
Back to School Mr. Bean !
 
mod-the-pc's Avatar
 
Join Date: Apr 2004
Location: Chennai
Posts: 343
Default Re: Javascript:1024 X 768 Screen Resolution

Quote:
Originally Posted by emailaatif786
Very Very much Thanks for replying,
You're welcome !
__________________
Desktop: P4 2.8E, Intel 865GBF, 512MB Hynix PC3200, Samsung SV1204H 120GB, Samsung SW-248F, Creative Inspire 4400, Samsung 793MB, Compro PVR/FM, WinLIRC

Laptop: HP Pavilion dv8210us
mod-the-pc is offline  
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by clmlbx
- by abhidev
- by Sarath
- by ico

Advertisement




All times are GMT +5.5. The time now is 02:44 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2