I have to run same pages on a laptop and a high res monitor so I want to dynamically alter font sizes graphic dimensions etc depending on screen resolution. My solution so far is to read the screen height or width and call a PHP page with appropriate variables even to the extent of opening an appropriately sized window. PHP then takes care of re-sizing fonts etc. from there.
My problem now is that I want to remove the set screen dimensions as there seems to be so many sizes shapes & resolutions of screen and dynamically adjust variables before opening new window and calling php pages.
My attempt was
This kinda works but doesnt - variables seem to get passed to PHP but window.open variables seem to be ignored. VERY VERY new to JS so all help welcomed and keep it simple please
Code:
function whichscreen(){
if ((screen.width == 1280) && (screen.height == 800))
msgWindow=window.open("new1.php?
bf=3&fr=800","displayWindow",
"left=0,top=0,width=1280,height=800,scrollbars=yes,resizeable=yes,toolbar=yes,status=no,menubar=no");
else if ((screen.width == 1280) && (screen.height == 1024))
msgWindow=window.open("new1.php?bf=3&fr=1024","displayWindow","left=00,top=0,fullscreen=no,width=1280,height=924,scrollbars=yes,resizeable=yes,toolbar=yes,status=no,menubar=no");
}
My problem now is that I want to remove the set screen dimensions as there seems to be so many sizes shapes & resolutions of screen and dynamically adjust variables before opening new window and calling php pages.
My attempt was
Code:
function whichscreen(){
wi=screen.width-200
wh=screen.height-100
fr=screen.height
msg='new1.php? bf=3&fr='+fr+',"displayWindow",
"left=0,top=0,width='+wi+',height='+wh+',
fullscreen=yes,scrollbars=yes,resizeable=yes,
toolbar=yes,status=no,menubar=yes'
msgWindow=window.open(msg);
}