|
I am looking for a way to detect the users screen resolution (in my case 800x600,1024x768,and 1600x1200) and automatically redirect them to the appropriate. The page needs to open in fullscreen mode without any scrollbars.
andy help would be great
|
|
|
When you say fullscreen, do you really mean fullscreen mode or just that the window is maximized? I don't know any way to actually force the new window to open in maximized state. You can detect the user's screen resolution and size your window approriately, but it won't be truly in maximized state.
w = screen.width;
h = screen.height; |
|
If you truly want fullscreen mode, I think it is IE only, but test it out. Remember, in fullscreen mode, the normal browser toolbar and even the Windows title bar is missing. This means the average user will not know how to close your window or exit fullscreen mode. You need to provide a close button or link for your users. Of course us geeks know we can press ALT-F4 to close the window. Here is a generic javascript function that I wrote for popping windows in my applications. I show you this function along with a sample link to pop a new window in fullscreen mode.
Copy & Paste this code into a new HTML document and open in your browser to test.
<script language=javascript>
function WinPop(winName, winSrc, winWidth, winHeight, scrollbars, menubar, toolbar, winStatus, resizable, winLocation, winTop, winLeft, fullscreen) {
winProps = "";
winProps = winProps + ((winWidth > 0) ? ",width="+winWidth : "") +
((winHeight > 0) ? ",height="+winHeight : "") +
((winTop > 0) ? ",top="+winTop : "") +
((winLeft > 0) ? ",left="+winLeft : "") +
((scrollbars == 0) ? ",scrollbars=0" : ",scrollbars=1") +
((menubar == 0) ? ",menubar=0" : ",menubar=1") +
((toolbar == 0) ? ",toolbar=0" : ",toolbar=1") +
((winStatus == 0) ? ",status=0" : ",status=1") +
((resizable == 0) ? ",resizable=0" : ",resizable=1") +
((winLocation == 0) ? ",location=0" : ",location=1") +
((fullscreen == 0) ? ",fullscreen=0" : ",fullscreen=1");
winProps = winProps.substring(1,winProps.length);
wname=window.open(winSrc, winName, winProps);
}
</script>
<a href="javascript:WinPop('_blank','http://www.codetoad.com',0,0,0,0,0,0,0,0,0,0,1)">View CodeToad.com in FULL Screen! Woohoo!</a>
|
|
|
|
|
|
|
|
|