Closed Thread Icon

Preserved Topic: Pop-up window Pages that link to <a href="https://ozoneasylum.com/backlink?for=7865" title="Pages that link to Preserved Topic: Pop-up window" rel="nofollow" >Preserved Topic: Pop-up window\

 
Author Thread
jediblah
Obsessive-Compulsive (I) Inmate

From:
Insane since: Oct 2001

posted posted 10-03-2001 04:44

Is it possible to have a pop-up window dynamical resize according the the image that it loads ? the image is being pulled from a database and the dimensions of the image isn't in the database.

HELP

Dracusis
Maniac (V) Inmate

From: Brisbane, Australia
Insane since: Apr 2001

posted posted 10-03-2001 06:19

If the server-side language your using can get the image dimensions then you could use those valuse in the popup code, apart fom that I'm not too sure...

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 10-03-2001 13:42

I started playing around with this concept and here's what I came up with: http://bugimus.com/gurus/image_popup/imagepopup.html

See if you can do anything with it. It should be able to resize itself to whatever image you place into the popup window. This code should be fixed up to watch for sizing the window larger than the user's screen. It currently positions the popup window to 30,30 on the screen and that could be made a little more dynamic too.

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 10-03-2001 14:05

jediblah: I don't have the exact code on me here but I do something similarish. It depends on what your server side scripting can do but you can get the image from the database and if you can't automatically get the image height and width (as you can in PHP) then you'll need to add this to the database and grab them at the same time you get the image. Then stick something like this in the BODY tag onload="window.resizeTo($height,$width);"

Adjust to suit (you may for example want to include a 50px high caption on each page, etc.).

Emps


You're my wife now Dave

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 10-04-2001 07:45

I would go for javascript approach...but this will only work w/ IE, netscape, you have to make something else....
the idea is:

code:
var myimage = new Image;
function adjustSize()
{
resizeTo(myimage.width, myimage.height); // resize the popup window
document.disparea.src = myimage.src;
}

function init()
{
myimage.src = "filename.jpg"; // preload
myimage.onload = "adjustSize();";
}

<body onload="init();">
<img src="wait.gif" alt="please wait" name="disparea">



i use that on this site.

« BackwardsOnwards »

Show Forum Drop Down Menu