Forum Moderators: open

Message Too Old, No Replies

adjusting window size to the size of the image

         

tiger5226

1:35 am on May 13, 2008 (gmt 0)

10+ Year Member



I have this php file for my site which I modified completely to fit what I wanted. I just have a minor adjustment that I want to make. I want the window that pops up to auto adjust to the size of the picture being displayed. Right now the picture is bigger than the window and you cannot adjust the size of it outside of script changes. My question is where and what would I put in the script to make this happen. I know when I wanted the thumbnails to be displayed 100 x 100 I had to add that to all of the script before it would work so I am assuming I would have to put the new script on all it at the bottom.

<?php
$prod = @$_GET['prod']; // Current Category ID

$imagerank="SELECT * from products WHERE pID='" . $prod . "' ";
$resultrank2=mysql_query($imagerank);
?>
<?php
while ($sSQL3 =mysql_fetch_array ($resultrank2) )
{
$simage1 = $sSQL3['pSmall1'];
$simage2 = $sSQL3['pSmall2'];
$simage3 = $sSQL3['pSmall3'];
$simage4 = $sSQL3['pSmall4'];

$limage1 = $sSQL3['pLarge1'];
$limage2 = $sSQL3['pLarge2'];
$limage3 = $sSQL3['pLarge3'];
$limage4 = $sSQL3['pLarge4'];

if(($simage1<=0) && ($simage2<=0) && ($simage3<=0) && ($simage4<=0)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage2','Image')\"><img src='$simage2' width='100' height='100' border='0'> </a> <br><a href=\"javascript:popImage('$limage3','Image')\"><img src='$simage3' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage4','Image')\"><img src='$simage4' width='100' height='100' border='0'> </a> ";}
else if(($simage1<=0) && ($simage2<=0) && ($simage3<=0) && ($simage4>=1)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage2','Image')\"><img src='$simage2' width='100' height='100' border='0'> </a> <br> <a href=\"javascript:popImage('$limage3','Image')\"><img src='$simage3' width='100' height='100' border='0'> </a> ";}
else if(($simage1<=0) && ($simage2<=0) && ($simage3>=1) && ($simage4>=1)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> <a href=\"javascript:popImage('$limage2','Image')\"><img src='$simage2' width='100' height='100' border='0'> </a> ";}

else if(($simage1<=0) && ($simage2>=1) && ($simage3>=1) && ($simage4>=1)){
print "<a href=\"javascript:popImage('$limage1','Image')\"><img src='$simage1' width='100' height='100' border='0'> </a> ";}
else if(($simage1>=1) && ($simage2>=1) && ($simage3>=1) && ($simage4>=1)){
print " ";}

}

?>

tiger5226

2:24 am on May 13, 2008 (gmt 0)

10+ Year Member



Hey guys also I should note that this script which is in the page that the javascript launches from has this code. But the settings in this code do not work. The window stays the same size not matter what pixels I put in there.
<script>
// Set the horizontal and vertical position for the popup
PositionX = 100;
PositionY = 100;
// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)
defaultWidth = 320;
defaultHeight = 320;
// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows
var AutoClose = true;
// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){