Solved

IE 4 - Target=blank force browser to open full screen

Posted on 1998-09-18
6
5,390 Views
Last Modified: 2008-03-03
When targeting a new window with the following:
<A href="page.htm" target="_blank">Click here</a>

Is there a way to force the browser to open maximized>
0
Comment
Question by:dejthor
  • 3
  • 2
6 Comments
 
LVL 12

Expert Comment

by:Otta
Comment Utility
It can be done, if the user's browser supports JavaScript,
and the user has not disabled JavaScript.
0
 
LVL 8

Accepted Solution

by:
jbirk earned 50 total points
Comment Utility
Yes, with Javascript you would use something like this:
<A href="javascript:void(0); onClick="window.open('page.htm','new_win','fullscreen,status,buttons,location');" >Click here</a>
That will open it into fullscreen mode and will only do this for IE 4.  If you want it to be maximized you can't truly 'maximize' it but you can make it's size the size of the screen, assuming that the user has netscape 4+ or IE 4+.  That would look something like this:
<A href="javascript:void(0); onClick="max_open();">Click here</a>
<SCRIPT language="JavaScript1.2">
<!-- cloak
x=screen.width;
if (x<=640) //640X480 screen
 window.open('page.htm','new_win',width=640,height=480,status,buttons,location');
else if (x<=800) //800X600 screen
 window.open('page.htm','new_win',width=800,height=600,status,buttons,location');
else if (x<=1024) //1024X768 screen
 window.open('page.htm','new_win',width=1024,height=768,status,buttons,location');
//and any other resolutions I missed??
// decloak -->
</SCRIPT>


Hope this is helpful,
Josh
0
 
LVL 1

Author Comment

by:dejthor
Comment Utility
When using the following:
<A href="javascript:void(0); onClick="window.open('page.htm','new_win','fullscreen,status,buttons,location');"

Two undesired results. First, while in full screen mode, there are no toolbars. Second, the frame that contains the href canges from a list hyperlinks to [object].

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 8

Expert Comment

by:jbirk
Comment Utility
OK, well the second problem was a simple caused because I missed a quote.  It should be:
<A href="javascript:void(0);" onClick="window.open('fullscreen.html','new_win','fullscreen,status,toolbar,location');">New fullscreen window</A>
Notice the quote after javascript:void(0);

The first problem I can't do anything about because apparently IE's fullscreen mode overrides any other requests for window features.  So basically there's nothing you can do about it if you want fullscreen mode.

You can always use something like this which will increase the window to the size of the screen and move it to starting in the upper left: (4+ browsers only)
<A HREF="javascript: if (window.resizeTo) window.resizeTo(screen.availWidth,screen.availHeight); if (window.moveTo) window.moveTo(0,0);">Fullscreen me</A>
That basically maximizes the current window. and doing this:
<BR><A href="javascript:void(0);" onClick="new_win=window.open('fullscreen.html','new_win','status,toolbar,resizable,location,scrollbars'); if (window.resizeTo) new_win.resizeTo(screen.availWidth,screen.availHeight); if (window.moveTo) new_win.moveTo(0,0);">new fullscreen window</A>
would open a new maximized window.

Note that the above two methods work like a charm in IE 4, but not quite as well N 4.  In netscape, it makes the window bigger than the available space, even though that is what we told it to use.

-Josh
0
 
LVL 1

Author Comment

by:dejthor
Comment Utility
OK using the following:
<A href="javascript:void(0);" onclick="window.open('../rosters/rosterall.htm','new_win','status,toolbar,resizable,location,scrollbars'); if (window.resizeTo) new_win.resizeTo(screen.availWidth,screen.availHeight); if (window.moveTo) new_win.moveTo(0,0)" onmouseover=rollon(); onmouseout=rolloff(); border = 0><SPAN class =Item>All Teams</SPAN></A>

Generates an error: new_win is undefined.
0
 
LVL 8

Expert Comment

by:jbirk
Comment Utility
You missed some of it in your copy paste.  Look above, I posted this:
<BR><A href="javascript:void(0);"
onClick="new_win=window.open('fullscreen.html','new_win','status,toolbar,resizable,location,scrollbars'); if (window.resizeTo) new_win.resizeTo(screen.availWidth,screen.availHeight); if (window.moveTo) new_win.moveTo(0,0);">new fullscreen window</A>

You left out the part that defines new_win at the beginning of the onClick action
("new_win=window.open....)

-Josh
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now