Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize popup window?

Status
Not open for further replies.

DVDGirl

Programmer
Mar 29, 2001
42
US
Hi -
I just want to resize a window to a particular dimension, say 100 x 100 pixels. When I use this code, it doesn't do anything. According to the status bar at the bottom of Internet Explorer, it says, "Error on page".

Here's the code:

<html>
<body>
<a href=&quot;#&quot; onClick=&quot;window.open('index.htm','width=100,height=100'); return false;&quot;>
<font color=&quot;#000000&quot; face=&quot;Arial Narrow&quot; size=&quot;2&quot;>
Hello</font></a>
</body>
</html>

Can anyone shed some light? Thank you in advance!

-DVD Girl
 
are you trying to resize the window the user is in? or a new one.
try
<a href=&quot;#&quot; onClick=&quot;window.open('index.htm', 'NewSize','width=100,height=100')&quot;>Hello

no need for the return false.
[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
I'm trying to resize the new window.

Basiclly, the user will click on a link in the main window. A new window pops up (which dimensions are 100 x 100), then after 3 seconds, it closes, leaving the main window in view.

I am able to do everything, BUT getting the new window's dimensions! :p
 
the changes I made to your code above work. did you try it out to see?
[bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
not sure if you have the timed close down but here's how I've done it in the past.
//first page
<html>
<body>
<a href=&quot;#&quot; OnClick=&quot;window.open('timed.htm', 'NewWindow','width=100,height=100'); return false&quot;>Want to see?
</body>
</html>

//popup or second page
//3000 = 3 seconds
<html>
<body onLoad=&quot;setTimeout(window.close, 3000)&quot;>
I think I'll go now!
</body>
</html> [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Thank you so much! That worked perfectly!

Sorry, but I was just dashing out of work before I replied that first time, so I didn't have time to check out the code. I just answered the question you asked!

Thank you again. I really appreciate your help!

-DVD Girl
 
Glad I could help out! [bomb]
I may not get it the 1st or 2nd time,
but how sweet that 15th time can be.
admin@onpntwebdesigns.com
 
Actually, return false IS necessary for older browsers. Not IE 6, but older ones do need return false.

Rick If I have helped you just click the first link below to let me know :)
 
Hi,

Any idea if i open a pop up window.
I minimize it. I target my next content to the same window.
But it doent pop up. What should be given do that a minimized window pops up again !!!

I hope i am clear

Viztek
 
To make a link that does that, do this:
<script>
<!--
function newer(loc){
new_win.location.href=loc;
new_win.moveTo(0,0);
new_win.resizeTo(availWidth,availHeight);
}
//-->
</script>
<a href=&quot;javascript:newer(&quot;page.html&quot;);&quot;>click!</a>
--assuming the new window is named &quot;new_win&quot;
--to make it named new_win, if it isn't, do this:
var new_win=window.open(blahblahblah);


That function will work for any link now. Just pass in the value for the page location.

Rick If I have helped you just click the first link below to let me know :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top