Forum Moderators: open

Message Too Old, No Replies

Open URL in new full screen window

         

outdoorxtreme1

1:07 am on Oct 31, 2005 (gmt 0)

10+ Year Member



What commands do I need to open a link in a new maximized window?

JAB Creations

11:24 pm on Oct 31, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is...

1.) new maximixed window without toolbars and buttons, etc.

2.) Completely fullscreen (like a DVD player).

I'm assuming you mean the later? I have the code for it someplace but I just can't find it right now.

kaled

12:26 am on Nov 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A quick Google yielded the following but I've not tested it.

window.moveTo(0,0);
window.resizeTo(screen.width,screen.height);

Kaled.

outdoorxtreme1

3:06 pm on Nov 1, 2005 (gmt 0)

10+ Year Member



A new window maximized with tool bar.

JAB Creations

3:40 pm on Nov 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Enjoy! :)
<html>
<head>
<title></title>
<script type="text/javascript">
function fullScreen(theURL) {
window.open(theURL, '', 'fullscreen=yes, scrollbars=auto');
}
</script>
</head>

<body>
<a href="javascript:void(0);" onclick="fullScreen('http://www.webmasterworld.com');">Open Full Screen Window</a>
</body>
</html>

~ John

outdoorxtreme1

4:19 pm on Nov 1, 2005 (gmt 0)

10+ Year Member



It still doesn't open right. another window opens but it is not maximized all the way.

I have the script entered and here is my link. Did I do something wrong?

<A HREF="javascript:void(0);" onclick="fullScreen('http://www.picturetrail.com/gallery/view?p=12&uid=4113287&gid=8623603&');">Slideshow</A>

kaled

5:38 pm on Nov 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I could be wrong, but I think browsers are careful about this sort of thing because of the potential for abuse.

Kaled.

JAB Creations

6:02 pm on Nov 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Firefox opens this in a maximixed window without any toolbars.

IE will open this completely fullscreen.

Opera 7.54 collasped my toolbars.

Opera 8.5 opened it as a normal link.

If there are other scripts that get various results across these and other browsers to get the link to work will require a moderately complex script beyond what I originally posted.

Anyone have anything to add with differing results?

outdoorxtreme1

6:38 pm on Nov 1, 2005 (gmt 0)

10+ Year Member



I am using Internet Explorer v6 and it's not opening it maximized. Could it be a browser setting?

outdoorxtreme1

6:57 pm on Nov 1, 2005 (gmt 0)

10+ Year Member



ok, it kinda works. I forgot to refresh the page. It maximizes the window but I want the tool bar to still be there

outdoorxtreme1

7:20 pm on Nov 1, 2005 (gmt 0)

10+ Year Member



What would I do to the link I am trying to open to get this JS code to work?

<!--
function openFullScreen(url) {
//Check browser
var isNav = (navigator.appName == "Netscape")?1:0;
var isIE = (navigator.appName.indexOf("Microsoft")!= -1)?1:0;
//Check Platform
var isMac=(navigator.platform.indexOf("Mac")>-1)?1:0;
var isWin=(navigator.platform.indexOf("Win")>-1)?1:0;
//Set global window options
var opts =
"toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizeable=n­o
,copyhistory=no,menubar=no"

//Set platform and browser specific options
if (isNav)
{
//Navigator windows have outerWidth and outerHeight properties

//use these to set window size to the available screen height
and width
opts =
opts+",outerWidth="+screen.availWidth+",outerHeight="+screen.availHeight+",­s
creenX=0,screenY=0";

}
else if (isIE) {
//IE has a "full-screen" option which can be used by placing
"fullscreen=yes" here
opts = opts+",left=0,top=0";
//To size the window (rather than open in fullscreen
mode) we need to know the padding
//i.e. the space taken by the title bar and window
edges. These values are subtracted
//from the available screen width and height (different
for Macs). If the new window
//is opened with toolbars, status bar, etc. the values
here should be changed to
//compensate for the new features.
if (isMac) {
//this uses a value of 13 for the extra width and 32
for the extra height
opts = opts+",width="+(screen.availWidth -
13)+",height="+(screen.availHeight - 32);
} else if (isWin) {
//this uses a value of 12 for the extra width and 25
for the extra height
opts = opts+",width="+(screen.availWidth -
12)+",height="+(screen.availHeight - 25);
} else {
opts =
opts+",width="+screen.availWidth+",height="+screen.availHeight;
}
} else {
return;
}
//Open a new window
var newWin = window.open(url,"NewWindow",opts);
newWin.focus();
//Move to 0,0 (JavaScript 1.2)
if (parseInt(navigator.appVersion) >= 4) {
newWin.moveTo(0,0);
}

}
// -->

JAB Creations

7:45 pm on Nov 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here are some suggestions and things I do when I'm trying to get something to work and I post on WebmasterWorld...

1.) If someone posts something with something I know can be referenced in a search engine I use pieces of their code in a search engine in order to come up with additional ideas to suggest. Sometimes I'll spend an hour trying to figure a solution if I find something I feel I can figure out on my own and sometimes it takes me a quick online reference. Even when I am doing a bit of research I consistently reload the thread to see if anyone else has posted/made suggestions (especially if I'm stuck).

2.) When I post code I post a full working example (typically). Impartial examples (of course <html> and other obvious tags not included) will not really help your, my, or anyone's cause too much.

Anyway that big chunk of code is umm, just that.

Try not to think of the web as IE/Netscape anymore. That was really back in the days of Netscape 4. I vaguely remember Mozilla and Firefox sharing a script someplace that required detecting and doing slightly different things for both browsers to work correctly, a GUI issue maybe?

Anyway what you're trying to do is somewhat simple, just a little lengthy. The script you posted was legnthy but also complex.

Ok...you also REALLY need to clarify what you do and do not specifically want showing up.

Address bar? (Y/N)
Bookmarks? (Y/N)
Buttons? (Y/N)
Status Bar? (Y/N)

I think there are various controls for those so I'll try and do a little research. If you do your own research it will help you figure out how to maximize your ability to figure out how to find stuff you want online. Sometimes the answers aren't complete, but if you know enough you can take small pieces of the puzzle and create your own image/script/etc.

Oh -- looks like a good resource for what we're working on here...
[yourhtmlsource.com...]