Home / Internet & Networking / Web design / Controlling Window Size
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: Controlling Window Size  (Read 3001 times)
rsagall
Guest
« on: July 13, 2004, 08:34:56 AM »

I have the need to open a small window as part of a counter mechanism. I have written a sample page (www.needymeds.com/counters/page_one.html) that has the link (AD2). That opens a page with a counter (counter1.html). I this page stays open only for a short time - as I want it to. However, there are two things I want to happen.

One is for the counter page (counter1.html) to be as small as possible. Two, when this page closes, I want to go to another page.

Any assistance or suggestions welcome.

Thanks,

Rich
IP logged
Joleen
Guest
« Reply #1 on: July 13, 2004, 08:47:33 AM »

try something like this..
Code: [Select]
<a href="#" onClick="MM_openBrWindow('path.html','optionspop','toolbar=no,location=no,menubar=no,scrollbars=no,status=yes,resizable=no,width=750,height=405')"

with the corrosponding
Code: [Select]
</a>.  The above is all one continuous line and no spaces between the ()

Of course your path will be very different and I'm using javascript as well.  The MM_openBrWindow is a function.

As for your second issue.  Use a onClose (similar to the onClick above) event to call another page.

Hope it helps
« Last Edit: July 13, 2004, 08:49:08 AM by Joleen » IP logged
rsagall
Guest
« Reply #2 on: July 13, 2004, 09:38:02 AM »

I tried the code you listed and had problems. Basically, it doesn’t take me to the page I want to go to. In the status bar I get a “Go To #” with no address. I left everything the same as you wrote it except replacing the path.html with the url of the page I want to go to.

Please let me know what I am doing wrong.

Thanks
IP logged
Joleen
Guest
« Reply #3 on: July 13, 2004, 10:56:35 AM »

Well, I'm opening the page via a JavaScript function so by copying the code you'll fall short.  You have to write the function yet.  That bit of code was a example, not to be taken literally.  Everything between the () are parameters sent to the function which uses all the variables and opens a new window based on what you send.  You should still be able to put something similar in the onClick event of your link.  The core of what you want is the height= and the width=.

Keep plugging away at it.
IP logged
SKy
Guest
« Reply #4 on: July 13, 2004, 03:13:39 PM »

Hi rsagall,
if u want to open a new AND control it's size, you need to write a bit of basic javascript. It shd be simple enough. Study the links below or google for 'open new window in javascript html'.

http://www.pageresource.com/jscript/jwinopen.htm
http://www.htmlgoodies.com/beyond/openwin.html
http://www.tek-tips.com/gfaqs.cfm/pid/216/fid/115
http://www.yourhtmlsource.com/javascript/popupwindows.html

Joleen provided a good example for your start.

If u want a 1-liner answer

<html>
<body>
<a href="javascript:window.open('http://www.google.com.sg', 'winname',
'width=400,height=300,scrollbars=no,menubar=no')">Open[/url]
</body>
</html>
IP logged
Pages: [1] - (Top) Print 
Home / Internet & Networking / Web design / Controlling Window Size « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.079 seconds with 18 queries.