codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Fullscreen / redirect  evision at 03:55 on Tuesday, April 06, 2004
 

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

  Re: Fullscreen / redirect  Troy Wolf at 16:05 on Tuesday, April 06, 2004
 

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>
Troy Wolf: site expert
SnippetEdit Website Editor









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Perl for Executing Shell Script
•  Re: Array and Threads
•  Re: .net
•  Compiling JAVA code in .NET?
•  Re: Please..HELP BADLY NEEDED!!
•  Re: need help with main()
•  Re: This forum sucks.
•  date calculation
•  Patter match in .jar file


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007