PDA

View Full Version : Enlarge Image not working



moods
10-14-2007, 11:43 PM
1) Script Title:

thumbnailviewer2

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm

3) Describe problem:

I am able to get the script to work with the title, just not the image.

http://thecampuscloset.com/selectgender.php?gen=Boys&category=Notre%20Dame%20Prep

Mouseover the image and nothing. Mouseover the words and it works.

I need it to also work when Mouseover the image. I have tried and tried. I am guessing it something very simply, but my brain hurts from trying so many combinations.

This is not my code. Another programmer. I am not sure how elegant it is?

I would also like to be able to click through if somebody clicks on the words, in this case "Boys Tops".

4) Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<tr>
<? if($img[$k]["subname"]!="")
{ ?>
<td><div align="center">
<a href="subcatg.php?s=<? echo $img[$k]["subname"]?>">
<?php
if("images/subimg/".$img[$k]['image'] != '' && getimagesize("images/subimg/".$img[$k]['image']))
{
$size = getimagesize("images/subimg/".$img[$k]['image']);
$pixel = explode('"',$size['3']);
if($pixel[1] > 150)
$width = 150;
else
$width = $pixel[1];
if($pixel[3] >150)
$height = 150;
else
$height = $pixel[3];
}
?>
<img border="2" src="images/subimg/<? echo $img[$k]["image"];?>" width="<?=$width?>" height="<?=$height?>" alt="<? echo $img[$k]["subname"]?>">

</a></div>
</td>
</tr>
<tr>
<td><div align="center"><a href="images/subimg/<? echo $img[$k]["image"];?>" rel="enlargeimage::mouseover" rev="loadarea::subcatg.php?s=<? echo $img[$k]["subname"]?>"><? echo $img[$k]["subname"];$k++?></a></div></td>
</tr>
</table>


Thank you for any helps.

Gary

jscheuer1
10-15-2007, 04:19 AM
The image isn't linked. This is easy to see in the generated source (use your browser's 'view source' to see it). You need to create the same link around it that you are creating around the text trigger.

Replace:


<img border="2" src="images/subimg/<? echo $img[$k]["image"];?>" width="<?=$width?>" height="<?=$height?>" alt="<? echo $img[$k]["subname"]?>">

With:


<a href="images/subimg/<? echo $img[$k]["image"];?>" rel="enlargeimage::mouseover" rev="loadarea::subcatg.php?s=<? echo $img[$k]["subname"]?>"><img border="2" src="images/subimg/<? echo $img[$k]["image"];?>" width="<?=$width?>" height="<?=$height?>" alt="<? echo $img[$k]["subname"]?>"></a>

You might want to change:

border="2"

to:

style="border:2px solid blue;"

due to the way linked image borders are treated in most browsers.

moods
10-15-2007, 01:54 PM
Thank you.

That does work now.

I still would like to click on the original image or the description below and go to the link similar to the image that pops up.

Thoughts?

Gary