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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using window.open with calculated width & height

Status
Not open for further replies.

Shurlock2

Technical User
Jul 24, 2007
1
NL
Hi people,

I have found faq216-5781 which tells me exactly what I was looking for, except for one minor issue.

I have some very large images that I wish to show in a new window, so I calculate the original sizes until they are well below 800x600.

The calculated sizes are placed in the variable tmpWidth and tmpHeight.
How can I add these variables to the line below, so the new window will be the exact size of the variables?

Code:
NewWindow = window.open("", "NewWindow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0)

Thanks in advance.
 
Something like this ought to do the trick:
Code:
[!]var[/i] NewWindow = window.open("", "NewWindow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0[!],width="+ tmpWidth +",height="+ tmpHeight[/!])[!];[/!]
Let us know how you get on!

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
How did this work out for you, Shurlock2? Did you find that it helped you?

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top