Forums

This topic is locked

repeat region with rollovers

Posted 22 Apr 2005 13:50:24
1
has voted
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>
&lt;?php do { ?&gt;
&lt;a href="mypage.php?name=&lt;?php echo $row_rsTable['linkname']?&gt;" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('&lt;?php echo $row_rsTable['linkname']?&gt;','','images/&lt;?php echo $row_rsTable['linkname']?&gt;sml.jpg',1)"&gt;&lt;img src="images/&lt;?php echo $row_rsTable['linkname']?&gt;smlmask.jpg" alt="&lt;?php echo $row_rsTable['linkname']?&gt;" name="Image24" width="60" height="57" border="0"&gt;&lt;/a&gt;
&lt;?php } while ($row_rsTable = mysql_fetch_assoc($rsTable)); ?&gt;
</font id=code></pre id=code>

When rendered in my browser produces:

<pre id=code><font face=courier size=2 id=code>
&lt;a href="mypage.php?name=name1" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('name1','','images/image1sml.jpg',1)"&gt;&lt;img src="images/image1smlmask.jpg" alt="name1" name="Image24" width="60" height="57" border="0"&gt;&lt;/a&gt;
&lt;a href="mypage.php?name=name2" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('name2','','images/image2sml.jpg',1)"&gt;&lt;img src="images/image2smlmask.jpg" alt="name2" name="Image24" width="60" height="57" border="0"&gt;&lt;/a&gt;

</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>
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&lt;%=RecordSet1.Fields.Item("field".Value%&gt;'
</font id=code></pre id=code>

&lt;hr&gt;<b>DMXZone support manager</b><br>&lt;a href="www.kousman.nl"&gt;Kousman web resellers&lt;/a&gt;

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
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?

Reply to this topic