/    Sign up×
Community /Pin to ProfileBookmark

"press button" to maximize

I am trying to make a JS script that shows some details and maximizes the page without the user having to press it.

So it shows a message, then it should maximize by “pressing F11”. Is this possible and also, is it possible to have no scrollbars without using frames?

to post a comment
JavaScript

11 Comments(s)

Copy linkTweet thisAlerts:
@oleragDec 30.2003 — For no scrollbar in a new window...

newWindow=window.open("","myWin","scrollbar=no");

By specifying no other parameters, the new window will have

the same characteristics as its parent.

I do not believe you can control the minimize/maximize

window action of browser windows from JS.
Copy linkTweet thisAlerts:
@aoeguyauthorDec 30.2003 — Isnt it possible without opening a new window?

If you cant maximize it then can you RESIZE it??

Well you can set most by opening new window.
Copy linkTweet thisAlerts:
@Paul_JrDec 30.2003 — [i]Originally posted by aoeguy [/i]

[B]Isnt it possible without opening a new window?[/b][/quote]

I don't believe so...
[i]Originally posted by aoeguy [/i][b]

If you cant maximize it then can you RESIZE it??[/b]
[/quote]

Yup.
[code=php]
<script type="text/javascript">
//<![CDATA[
function bigger() {
window.resizeTo(screen.width,screen.height);
}
//]]>
</script>
[/code]

Then
[code=php]
<input type="button" name="resizer" value="Click to resize" onclick="bigger()" />
[/code]

Works for me.
Copy linkTweet thisAlerts:
@aoeguyauthorDec 30.2003 — Whats that CDATA stuff for and does that resize it to the screen res?

Can I open the same page then close the parent window?

window.open(me.html, settings bla no scrollbar...);

window.close
Copy linkTweet thisAlerts:
@oleragDec 30.2003 — To open a window in JS to the size of the screen...
[code=php]
<script type="text/javascript">
var newWin = "";
function openNewWin() {
var winAtt = "menubar=1,status=1,location=1,directories=1,resizable=1," +
"height=" + screen.height + ",width=" + screen.width + "top=0,left=0";
newWin = window.open("","",winAtt);
}
</script>
[/code]



[b]Can I open the same page then close the parent window?[/b]
[/quote]

The same page has no parent. A new page would have a

parent but to close the parent without the child is, I believe,

not very good practice. However, in some browsers...

Call a JS function residing in the parent window that closes

itself (top.close()) could be done I suppose. To call a parent's

function, issue something like "window.opener.myFunction()".
Copy linkTweet thisAlerts:
@fredmvDec 30.2003 — [i]Originally posted by aoeguy [/i]

[B]Whats that CDATA stuff for[/B][/QUOTE]
http://www.webxpertz.net/forums/showthread.php3?s=&threadid=27224#post147808
Copy linkTweet thisAlerts:
@aoeguyauthorDec 30.2003 — I mean open the same page in a new window.

A = p1.html

A.2 = opened and maximized etc. p1.html

A is opened

A.2 opens up

A closes
Copy linkTweet thisAlerts:
@zachzachDec 30.2003 — do you need it?
Copy linkTweet thisAlerts:
@aoeguyauthorDec 30.2003 — For the scrollbars to disapear, yes.
Copy linkTweet thisAlerts:
@oleragDec 30.2003 — Well, I already gave you an example of opening a new

window (in your case, it'll be the same window so put this

URL in the "open" functions first arg) that is the same size

as your screen. To control the other window attributes,

adjust the "winAtt" variable as desired. Another is

"scrollbars" so "scrollbars=0".

Closing a parent from a child does not work in all browsers

but should work for IE6. Again, closing a parent and leaving

the child is not, I believe, a good practice and is to be

discouraged.

I think your "resizeTo" option is the best but I do not

believe you can discontinue the scrollbars once a window

has been opened with them.
Copy linkTweet thisAlerts:
@aoeguyauthorDec 30.2003 — Ok, I stick with just resize and might have to use frame s then. ?
×

Success!

Help @aoeguy 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 5.16,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...