PDA

View Full Version : Need Help With Screen Resolution Detection



rickjwilliams
12-28-2005, 08:32 PM
Hello,

I would like to use the java script code below on my splash screen for screen resolution detection.

But what I would like for it to do is give an "alert notice". Like the one used in
the code for "NO right mouse button". Could someone tell me , or show me how this is done?

Thanks,

Rick



<script language="JavaScript1.2">
<!--

/*
Screen resolution detection and notification Script-
Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

var correctwidth=1024
var correctheight=768
if (screen.width!=correctwidth||screen.height!=correctheight)
document.write("This webpage is bested viewed with screen resolution "+correctwidth+"*"+correctheight+". Your current resolution is "+screen.width+"*"+screen.height+". If possible, please change the resolution!")
//-->
</script>