Forums
This topic is locked
repeat region with rollovers
22 Apr 2005 13:50:24 Dan Slade posted:
Does anyone know if it's possible to make a rollover image work within a repeat region (mysql/php)?I've inserted the rollover image with all its properties being dynamic (no problem there). Tested it, and the image swaps and links correctly.
However, when I use a repeat region behaviour to pull all the rollovers from my database, all works fine (all images are displayed, all links work, alt text works fine), but the images don't swap anymore.
The source code in DW for is:
<pre id=code><font face=courier size=2 id=code>
<?php do { ?>
<a href="mypage.php?name=<?php echo $row_rsTable['linkname']?>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('<?php echo $row_rsTable['linkname']?>','','images/<?php echo $row_rsTable['linkname']?>sml.jpg',1)"><img src="images/<?php echo $row_rsTable['linkname']?>smlmask.jpg" alt="<?php echo $row_rsTable['linkname']?>" name="Image24" width="60" height="57" border="0"></a>
<?php } while ($row_rsTable = mysql_fetch_assoc($rsTable)); ?>
</font id=code></pre id=code>
When rendered in my browser produces:
<pre id=code><font face=courier size=2 id=code>
<a href="mypage.php?name=name1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('name1','','images/image1sml.jpg',1)"><img src="images/image1smlmask.jpg" alt="name1" name="Image24" width="60" height="57" border="0"></a>
<a href="mypage.php?name=name2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('name2','','images/image2sml.jpg',1)"><img src="images/image2smlmask.jpg" alt="name2" name="Image24" width="60" height="57" border="0"></a>
</font id=code></pre id=code>
etc...
Everything is fine, but the images won't swap when the repeat region is applied.
Does anyone know how to fix this and make my rollovers work?
Many thanks,
Dan.
---------------------------------------------
If I knew what I was doing, I'd be dangerous...
Replies
Replied 22 Apr 2005 20:43:43
22 Apr 2005 20:43:43 Dave Thomas replied:
i do it using css.
instead of the swapImage, which gives an error when applied in a repeat region.
set up the a:link u want with a background image what u normally want showing.
then on the a:hover, have your swap image as the background.
regards
Dave Thomas
<b>DMX Zone Manager</b>
instead of the swapImage, which gives an error when applied in a repeat region.
set up the a:link u want with a background image what u normally want showing.
then on the a:hover, have your swap image as the background.
regards
Dave Thomas
<b>DMX Zone Manager</b>
Replied 24 Apr 2005 21:01:08
24 Apr 2005 21:01:08 Rene Bandsma replied:
I should change the following code:
<pre id=code><font face=courier size=2 id=code>
onMouseOver="MM_swapImage('name1'
</font id=code></pre id=code>
To something like this (I'm ASP only programmer:
<pre id=code><font face=courier size=2 id=code>
onMouseOver="MM_swapImage('name1<%=RecordSet1.Fields.Item("field".Value%>'
</font id=code></pre id=code>
<hr><b>DMXZone support manager</b><br><a href="www.kousman.nl">Kousman web resellers</a>
Edited by - bandsma on 24 Apr 2005 21:02:20
<pre id=code><font face=courier size=2 id=code>
onMouseOver="MM_swapImage('name1'
</font id=code></pre id=code>
To something like this (I'm ASP only programmer:
<pre id=code><font face=courier size=2 id=code>
onMouseOver="MM_swapImage('name1<%=RecordSet1.Fields.Item("field".Value%>'
</font id=code></pre id=code>
<hr><b>DMXZone support manager</b><br><a href="www.kousman.nl">Kousman web resellers</a>
Edited by - bandsma on 24 Apr 2005 21:02:20
Replied 14 Dec 2006 17:25:50
14 Dec 2006 17:25:50 Dave Desormeaux replied:
Did you ever find a solution to this?
I'm having the same trouble finding something that works - plenty of asp solutions but
not much in PHP.
Thanks!
Dave
I'm having the same trouble finding something that works - plenty of asp solutions but
not much in PHP.
Thanks!
Dave
Replied 19 Dec 2006 18:09:36
19 Dec 2006 18:09:36 Roddy Dairion replied:
I could probably help but can you tell me exactly whats happening? I understand that you have an image link and that when you apply a rollover to it then it doesn't work. But what code are you using and how did you set it in your code?