|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
Can someone tell me how to obtain the resolution of the client browser in javascript. I don't found this in the navigator object. Regards |
|
#2
|
|||
|
|||
|
Hi Phil, You might be a little confused here - of course, I might be a little confused too? The term 'Resolution' describes a monitor setting of the user's computer. It's not a browser setting and I don't think you can access that info. from JS or from the web browser. ------------------ Matthew J. Flynn http://webcoder.net |
|
#3
|
|||
|
|||
|
You can get the current Resoultion through JS
Here is how to do it <SCRIPT LANGUAGE=javascript>var xy = navigator.appVersion;xz = xy.substring(0,4);document.write('<B> ',screen.width,' x ',screen.height,'</B>')</SCRIPT> This will write it to the document. ------------------ L8Rz WhiteKnight |
|
#4
|
|||
|
|||
|
Here is the same thing, but it notifies the client if the resolution does not match the anticipated design resolution.
<head> </script> <script language="JavaScript1.2"> var winX = screen.width; var winY = screen.height; if (winX <= '640') { newWindow = window.open('reswarning.htm', '', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="no",width=300,height=225'); } </script> </head> In the reswarning.htm (pop-up window) file, you can also insert this piece of JavaScript code for additional enhancement. <script language="JavaScript1.2"> var winX = screen.width; var winY = screen.height; document.write('Your screen resolution is ' + winX + ' x ' + winY + ', which is below the recommended size for this application. If possible, please reset your screen resolution to 800 x 600 or higher. Thank you!'); </script> --Good Luck ------------------ Striker |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > How to obtain the current browser resolution |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|