473,394 Members | 2,052 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Open Screen Full Window

I have pull-down menus in javascript and I have the code for opening a link
in a new window. But I want it to open a full-sized window. I can't figure
out the syntax. What I have so far:

Menu5_5_1=new Array("'Lonely Church","javascript:window.open
('http://www.photo.net/photodb/photo?photo_id=2640310')","",0,20,300);

That works fine, except I can't figure out how to modify it to make it open
full-screen.

Tips?

LRH
Jul 23 '05 #1
2 4363
On Fri, 27 Aug 2004 12:46:42 -0700, "Larry R Harrison Jr"
<no***@noone.com> wrote:
I have pull-down menus in javascript and I have the code for opening a link
in a new window. But I want it to open a full-sized window. I can't figure
out the syntax. What I have so far:

Menu5_5_1=new Array("'Lonely Church","javascript:window.open
('http://www.photo.net/photodb/photo?photo_id=2640310')","",0,20,300);

Loop up more info on the window.open() method, before the end bracket
there is more options you can put in it.

window.open('file', 'winname', 'features');

eg
window.open('photo.asp', 'PictureWindow', 'width=300, height=300')

if you want to do full screen in IE then put "fullscreen" in the
features part.

below is the open window script I use.

HTH

Al.
function newWindow(sFilenameToView, sWindowName, iWidth, iHeight,
sCanScroll, bCanResize, iLeft, iTop, sExtraSettings, bReplaceHistory)
{
var oNewWin = null;
if (!sExtraSettings) {sExtraSettings='';}
// iWidth/iHeight=-1 for netscape to go "near as damit" full
screen
// NS user needs to press F11 to go true full screen.
if (iWidth == -1 || iHeight == -1) {
sExtraSettings =
sExtraSettings.replace(/fullscreen/gi, '');
if (sExtraSettings) {sExtraSettings += ',';}
sExtraSettings += 'fullscreen, outerWidth=' +
screen.width + ', outerHeight=' + screen.height;
iLeft = 0;
iTop = 0;
}
var iLeftPosition = iLeft;
var iTopPosition = iTop;
// iLeft/iTop=-1 centers the newwindow on the screen
if (iLeft == -1 || iTop == -1) {
iLeftPosition = (screen.availWidth) ?
(screen.availWidth - iWidth) / 2 : 0;
iTopPosition = (screen.availHeight) ?
(screen.availHeight - iHeight) / 2 : 0;
}

var sWindowSettings = 'height=' + iHeight + ',width=' + iWidth
+ ',top=' + iTopPosition + ',left=' + iLeftPosition + ',scrollbars=' +
sCanScroll + ',resizable=' + bCanResize + ',' + sExtraSettings;
oNewWin = window.open(sFilenameToView, sWindowName,
sWindowSettings, bReplaceHistory);
oNewWin.focus();
return oNewWin;
}
That works fine, except I can't figure out how to modify it to make it open
full-screen.

Tips?

LRH


Jul 23 '05 #2
Harag wrote:
On Fri, 27 Aug 2004 12:46:42 -0700, "Larry R Harrison Jr"
<no***@noone.com> wrote:
I have pull-down menus in javascript and I have the code for opening a link
in a new window. But I want it to open a full-sized window. I can't figure
out the syntax. What I have so far:

Menu5_5_1=new Array("'Lonely Church","javascript:window.open
('http://www.photo.net/photodb/photo?photo_id=2640310')","",0,20,300);

Loop up more info on the window.open() method, before the end bracket
there is more options you can put in it.

window.open('file', 'winname', 'features');

eg
window.open('photo.asp', 'PictureWindow', 'width=300, height=300')


The 3rd parameter should not contain any spaces. Some user agents do not honor
your "features" if you include any white space.
if you want to do full screen in IE then put "fullscreen" in the
features part.


Documentation for window.open():

IE: <url:
http://msdn.microsoft.com/workshop/a...ods/open_0.asp />
Netscape 4 (although most of this stuff is fairly cross-browser): <url:
http://devedge.netscape.com/library/...w.html#1202731
/>
Gecko-based browsers (Mozilla, Firefox, Camino, Netscape 7): <url:
http://www.mozilla.org/docs/dom/domr...6.html#1019331 />

Note that the Gecko DOM reference appears incomplete. I believe the features
list for window.open() on Gecko-based browsers supports both screenX/Y and
top/left (I'm probably wrong and I'm too lazy to test it).

Also, Gecko-based browsers support "fullscreen=1", but it is not the same as the
effect you get when you do it in IE.

As a general rule-of-thumb when it comes to window.open() there is no general
rule-of-thumb. You'll want to check the documentation for each user agent you
want to support, then test the resulting code to ensure it works as documented.

And after all that, there's no guarantee your attempt to open a new window in my
user agent will be honored anyway. window.open() in my user agent either a) does
nothing or b) if I really need the window to perform some task, it opens in a
new tab which will not be resizable.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

40
by: Brian Jorgenson | last post by:
On my web page, I have a few hyperlinks with target frame of _blank. The hyperlink brings up a second window, but everytime I click on thie hperlink, it keeps bringing up a new window and not...
5
by: Sean Berry | last post by:
I have a news video that I am sending out for a client. There are embedded links to flash movies in the email. I want the popup to be a set size (400 x 400). I am currently using the...
6
by: Mateo | last post by:
Hi! I tried to open page in new window with window.open(...) method. open() method supports fullscreeen mode, but I would like to open new maximized window with tiltle bar only.... Any idea...
1
by: yuenli | last post by:
Hi! I am facing a problem here. I wish to open a sub window from another sub window which means when i click on the main parent window a small window will appear then when i click on the button on...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I open a new window with javascript?...
4
by: RobertTheProgrammer | last post by:
Hi all, I'm a bit of a novice with javascript, so be patient with me... I'm using the "window.open" function to open a new window from my page. I actually have several buttons on my page that...
1
by: visweswaran28 | last post by:
i developed a web page using frameset concepts... if i click any link in that frame the new page will open within that frame size. i want to open in full window. how do i change. could u help me...
4
by: tvnaidu | last post by:
I have MFC application, if I execute app on laptop, it doesnot show full window, it shows 80% on full screen , remaining 20% go bottom, whereas on Desktop it shows complete, on laptop resolution is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.