View Full Version : Find screen resolution using javascript/other language e.g. 1280x1024 ??
SlRRex
03-26-2008, 08:07 AM
I want to find the screen resolution using javascript so that it can load a different image in a CSS script depending on the user's screen resolution. e.g. http://khushman1.googlepages.com/gmaps-index.htmlThe pic is a 1024x768 pic, but I have a 1280x1024 resolution, so how do I change the code so that it loads a different picture depending on the user's resolution.Any other language is also OK but the code should work.
RavindraG
03-26-2008, 08:22 AM
May be this helps youvar windowWidth = 0, windowHeight = 0;if( typeof( window.innerWidth ) == 'number' ) {//Non-IEwindowWidth = window.innerWidth;windowHeight = window.innerHeight;} else if( document.documentElement && (document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {//IE 6+ in 'standards compliant mode'windowWidth = documen0t.documentElement.clientWidth;windowHeight = document.documentElement.clientHeight;} else if( document.body && ( document.body.clientWidth ||document.body.clientHeight ) ) {//IE 4 compatiblewindowWidth = document.body.clientWidth;windowHeight = document.body.clientHeight;}
sanjeevs
03-26-2008, 08:36 AM
right click on desktop >>properties>>setting>>advance>>adapter>> list modes>>choose 1024X768 and apply "" ok""
vBulletin® v3.7.0, Copyright ©2000-2010, Jelsoft Enterprises Ltd.