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

POP up window

Status
Not open for further replies.

matttoby

Programmer
Mar 30, 2001
14
GB
I have a number of pictures of different sizes with their locations stored in a database. I am hoping to be able to open them in a pop up window when the user clicks on a URL. The problem I have is that I don’t know the sizes of the pictures before I open them. Is there anyway I can make the pop up window fit the size of the picture?

Many Thanks

Matt
 
Sounds like you are using asp or some other server-side technology to store the picture location in the database, you could also store the image size there and add it to the hyperlink as a querystring...

Or...

Javascript solution(in you IMG tag):

popUp.htm

<IMG onLoad=&quot;window.resizeTo(this.width, this.height)&quot;>

Let me know if this gives you porblems, you can write a more robust solution if this fails.

Get the Best Answers! faq333-2924
Is this an asp FAQ? faq333-3048
Tek-Tips Best Practices: FAQ183-3179
 
Hi,

I am using ASP in the way described.

The problem I have is that there are thousands of photographs currently stored without their dimensions being stored with them. I was hoping there was a way of resizing the window without having the image dimensions stored. I’m not sure if what I’m asking is going to be possible without collecting the image size data in the way you have suggested???

Many thanks for your help.

Matt
 
My Appologies

I missed the 'or' and it works more or less perfectly.

Many Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top