473,581 Members | 2,204 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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","javasc ript:window.ope n
('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 4384
On Fri, 27 Aug 2004 12:46:42 -0700, "Larry R Harrison Jr"
<no***@noone.co m> 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=ne w Array("'Lonely Church","javasc ript:window.ope n
('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('fi le', 'winname', 'features');

eg
window.open('ph oto.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(sFile nameToView, sWindowName, iWidth, iHeight,
sCanScroll, bCanResize, iLeft, iTop, sExtraSettings, bReplaceHistory )
{
var oNewWin = null;
if (!sExtraSetting s) {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.availWi dth) ?
(screen.availWi dth - iWidth) / 2 : 0;
iTopPosition = (screen.availHe ight) ?
(screen.availHe ight - iHeight) / 2 : 0;
}

var sWindowSettings = 'height=' + iHeight + ',width=' + iWidth
+ ',top=' + iTopPosition + ',left=' + iLeftPosition + ',scrollbars=' +
sCanScroll + ',resizable=' + bCanResize + ',' + sExtraSettings;
oNewWin = window.open(sFi lenameToView, 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.co m> 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=ne w Array("'Lonely Church","javasc ript:window.ope n
('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('fi le', 'winname', 'features');

eg
window.open('ph oto.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*****@agrico reunited.com>
comp.lang.javas cript 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
10799
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 defaulting the the first active window. How do I make a hyperlink point to the active window? I don not want the hyperlink to default to the same page. I...
5
2277
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 following code, but the popup window is not 400 x 400, it is whatever the browser size was last time it was opened. How can I set the absolute size from...
6
8988
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 how to do this? Can I maximize window from current page after it is opened with window.open?
1
2111
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 the small window another smaller window will appear. Thanks in advance. Here is my code: <html> <head><title>Date Picker</title> <script...
1
1243
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I open a new window with javascript? ----------------------------------------------------------------------- New windows can be opened on browsers that support the ` window.open ` function and are not subject to the action of any pop-up blocking...
4
1841
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 each opens the same page with the "window.open" function, but each time it uses a different parameter. (i.e. window.open('NewWindow.html?params=1')...
1
1713
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
3918
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 1024X768, where as on desktop it is higher resolution, any idea how can I get full window on laptop?. appreciated.
0
7792
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8304
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8175
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6553
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3805
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1403
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1138
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.