PDA

View Full Version : window.resize question



dianett
11-27-2005, 02:01 PM
hello everyone! i've been searching and reading around the forum but haven't been able to find something that could help what i'm currently trying to do.

i like this script below to resize the browser but is there a way to disable the address bar/menu, toolbar? i've tried hide() doesn't seem to work :D

<script>
window.resizeTo(222, 505);
</script>

thank you so much in advance for comments and suggestions. have a great day! :)

edit : sorry does anyone know the pros and cons of this? i've heard numerous debates about firefox not working with this script. oh, heh i should go install it :o

dianett
11-27-2005, 03:58 PM
oops this should be in html >.<

Twey
11-27-2005, 04:08 PM
This does work with Firefox, but there is an option which is set by default to disallow scripts from resizing an existing window. You cannot remove the toolbars from an existing window, but you can create a new window without them using the third parameter of window.open().

my sushi secret
07-25-2006, 10:07 PM
You cannot remove the toolbars from an existing window, but you can create a new window without them using the third parameter of window.open().

What is the script to do this in a new window? I have never gotten this to work!

Twey
07-25-2006, 11:04 PM
window.open('http://www.example.com/url/', '', 'toolbar=no,location=no,menubar=no,directories=no');

my sushi secret
07-27-2006, 03:12 AM
Thank you so much, I got this to work, but I'm doing something else wrong.

This is for my portfolio page; I want my homepage to have the toolbars, but when the portfolio link is clicked, I want a new window to open without the toolbars. I've seen sites that do this, but don't see the code when I view the source.

As of now, when I click the portfolio link from the main page, one window pops up with the toolbars, and then another one pops up without (but they both have the same content). How do I make the link open a page with no toolbars?

Rikki

Manny
07-27-2006, 01:20 PM
Rikki, try this (code to go in your homepage):

<html>
<head>
<title>homepage</title>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval = window.open(URL, 'name', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=250');
eval.moveTo(5,5);
}

// End -->
</script>
</head>
<body>

<a href="javascript:popUp('myportfolio.htm')">My portfolio</a>

</body>
</html>

Change the "eval.moveTo(5,5);" to position the window wherever you want to on the page.