/    Sign up×
Community /Pin to ProfileBookmark

Max Min Max Min Max Min etc…

I have this code to maximize a window:

[CODE]<script>
<!–
function fullwin(){
window.open(“site.php”,””,”statusbar,menubar,fullscreen,scrollbars”)
}
//–>
</script>
<input type=”button” onClick=”fullwin()” value=”Open window”>[/CODE]

now that page takes over the whole screen, as well as the windows taskbar…
What is the code for a button that maximizes the window THIS WAY and to return it to a normal screen?
Greetzzz tAK

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@fredmvFeb 23.2004 — [i]Originally posted by The Anime King [/i][B]

What is the code for a button that maximizes the window THIS WAY and to return it to a normal screen?[/B]
[/QUOTE]
Care to elaborate? Basically, you'd set the dimensions of the new window to [font=courier]screen.availWidth[/font] and [font=courier]screen.availHeight[/font].
Copy linkTweet thisAlerts:
@The_Anime_KingauthorFeb 23.2004 — hey

please no hard english words ? english is only my second language (i'm dutch) so i understand most of the talk on this forum, but for the word "elaboration" i fetched my dictionary...

Ok, i made an example on my site:

http://members.lycos.nl/rpgcontestdb/site.php

You can click the button to see what happens. A big version of the same page comes up. Now i need a button that returns the page to it's normal size.

and question 2:

i need a way to make the first page full screen, without opening a new window. No availWidth stuff, because the site really really needs to fill the whole screen. Otherwise, 800x600 browsers get horizontal scrollbars...

Greetzzz tAK
Copy linkTweet thisAlerts:
@The_Anime_KingauthorFeb 24.2004 — Someone? Please?
Copy linkTweet thisAlerts:
@oleragFeb 24.2004 — For your first question, here's some sample code. You can

adjust your pop-win attributes as desired.
[code=php]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<title>Pop Window Sample</title>
<script type="text/javascript">
var newWin;

function openPopWin(mode) {
var w = screen.availWidth;
var h = screen.availHeight;
var l = 0;
var t = 0;

if (mode == "half") {
w = w/2;
h = h/2;
l = (screen.width - w) / 2;
t = (screen.height - h) / 2;
}

var winAtt = "width="+w+",height="+h+",top="+t+",left="+l+",scrollbars=0,toolbar=0,menubar=0,resizable=0,location=0,status=0";

if (newWin != null) {
newWin.close();
}

if (!newWin || newWin.closed) {
newWin = window.open("", "newWin", winAtt);
newWin.document.write("Hello World");
}
}
</script>

<div style="text-align: center;">
<strong>Pop Window Sample</strong>
</div>

<form action="#">
<p style="text-align: center;">
<input type="button" value="Open Half Size" onClick="openPopWin('half')">
<input type="button" value="Open Full Size" onClick="openPopWin('full')">
</p>
</form>
[/code]

As for altering the window size of your parent window, I do

not believe that this is possible. If I'm incorrect, hopefully

someone will provide the proper information.
×

Success!

Help @The_Anime_King spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...