Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

two time, one time, one size, two size, one pic, two pic

Hadji_13Hadji_13 Posts: 274Member
Hi, I've got a problem with some code.
It should open a window with two images in, that what the php page it's calling has, the two images passed to it.
The problem I'm having is that the window never opens the right size the first time you view it in a session, if you close the pop up window and click the link again, it works.
I'm trying to add the sizes of the pictures in the argument, but for some reason, on the first time it only opens to the size of the first image.
Anyone to shed any light?

This is the code

[code]
function twolayouts(img1,img2)
{
foto1= new Image();
foto1.src=(img1);
foto2= new Image();
foto2.src=(img2);

largh=foto1.width+foto2.width+20;
if(foto1.height>foto2.height)
{
altez=foto1.height+20;
}
else
{
altez=foto2.height+20;
}
page="twolayouts.php?img1="+img1+"&img2="+img2;
stringa="width="+largh+",height="+altez;
finestra=window.open(page,"",stringa);

}
[/code]
----------------------------------------------------
The solution to the problem changes the problem
Sign In or Register to comment.