Basically I need to use DHTML to position something on a screen and have just discovered on my work machine which has two monitors at 1280 width each my calculation breaks since the screen.width property returns the size of the two monitors combined. Of course, nobody would ever being using both screens for a single window (and in Gnome I can't maximize if I do that) so I need to get the width of just the one screen.
I've written a function:
Code: Select all
function isDualScreen()
{
var res = screen.width/screen.height;
if (Math.abs((res - (4/3))) < Math.abs((res - (8/3))))
{
return false;
}
else
{
return true;
}
}