Thumbnail ID request

Hi People,
I have a little problem. I included a Javascript in my phpAlbum, so I can do a rollover-effect to my thumbnails. The problem is, it works only with the first thumbnail, because I don't know the thumbnail_id, but the javascript needs it.

The Javascript is following (in album.tpl.php):

<script type="text/javascript">
    Normal1 = new Image();
    Normal1.src = "./themes/Borders/grey.png";
    Highlight1 = new Image();
    Highlight1.src = "./themes/Borders/blank.png";

function Bildwechsel (Bildnr, Bildobjekt) {
  window.document.images[Bildnr].src = Bildobjekt.src;
}
</script>

The call is in thmb.tpl.php

<a href="<? print $image_view_link; ?>" onmouseover="Bildwechsel(0, Highlight1)" onmouseout="Bildwechsel(0, Normal1)" target="_blank">

Where here is Bildwechsel, I need to hand over the number of the thumbnail, something like a count, I tried with $cnt, which is the count variable in the engine.php, but didn't work!

You can see the problem on:

http://ldlove.lima-city.de/typo3/index.php?id=27

Please can anybody help me, I getting crazy with this problem!

Thx a lot,

David

patrik's picture

Hi,

Hi,

you could post following code on the beginning of thmb.tpl.php :

<?php

  if(isset($own_count)){
   
$my_count++;
  }else{
       
$my_count=0;
}
?>

And later use this variable in calling of the function Bildwechsel.

Bildwechsel(<?php echo $my_count;?>,Normal)

This should work.

But i think for features like this it is easier to use CSS.

Thanks a lot! Your solution

Thanks a lot!
Your solution didn't work that way, but it leaded me to the right way!

Thanks, thanks, thanks!

You can have a look to the thing I made on
http://ldlove.lima-city.de/typo3

FotoJoep's picture

Great pictures, only maybe

Great pictures, only maybe you should point out to the fact that you can only watch the pictures when you use Internet Explorer or FireFox with IETab installed and active.

---
Joep Meijer

Using phpAlbum on
fotos.vanjoep.nl
spoorzoekerfotos.vanjoep.nl

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.