close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Issue with image swap behaviour in grid layout results

Thread began 8/13/2010 3:06 pm by iainmacdonald331081 | Last modified 8/16/2010 10:21 am by Jason Byrnes | 904 views | 4 replies |


Issue with image swap behaviour in grid layout results

Not sure what the problem is here - I've got a page with some results in a grid layout repeating table, with a button to view the details page.

However, the image swap behaviour on the 'Learn More...' button only seems to work if there is only one result :


But if there are more than one result it doesn't work :


This is the code :

<img src="images/learnbutton1.jpg" alt="View" name="View" border="0" id="View" onMouseOver="MM_swapImage('View','','plugins/images/learnbutton2.jpg',1)" onMouseOut="MM_swapImgRestore()"  />

Any ideas?

Sign in to reply to this post


Works fine on multiple results for me here (Firefox, IE7, IE8, Safari, Google Chrome).

Sign in to reply to this post


That's weird - doesn't seem to be here on Safari or Firefox (mac). The rollover, or the link?

Maybe its just a weird thing on my machine.

Sign in to reply to this post


Hi Ian,

I don't know what I was on last night, but have checked and rollovers are not working as I said.

I think (others may confirm/explode) that each instance of the swap image behaviour has to have a distinct name/ID, i.e. image1, image2 etc for each instance to work:

<body onload="MM_preloadImages('plugins/images/learnbutton2.jpg')">
<p><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','plugins/images/learnbutton2.jpg',1)"><img src="images/learnbutton1.jpg" name="Image1" width="123" height="25" border="0" id="Image1" /></a></p>
<p><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','plugins/images/learnbutton2.jpg',1)"><img src="images/learnbutton1.jpg" name="Image2" width="123" height="25" border="0" id="Image2" /></a></p>
<p><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','plugins/images/learnbutton2.jpg',1)"><img src="images/learnbutton1.jpg" name="Image3" width="123" height="25" border="0" id="Image3" /></a></p>
<p><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','plugins/images/learnbutton2.jpg',1)"><img src="images/learnbutton1.jpg" name="Image4" width="123" height="25" border="0" id="Image4" /></a></p>

If I copy code for line 1 and paste to get more instances (so each has same name/ID) the roll-over fails. If these are being added dynamically, an incremental value will need (I believe) to be dynamically assigned to each instance.

The above code can be seen in a 'clean' page example here

Sign in to reply to this post

Jason ByrnesWebAssist

Neilo, you are exactly correct:

each image will need to have a unique ID:

<img src="images/learnbutton1.jpg" name="Image1" width="123" height="25" border="0" id="Image1" />
<img src="images/learnbutton1.jpg" name="Image2" width="123" height="25" border="0" id="Image2" />

and the onMouseOver code will need to be adjusted to usee that images unique id value:

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...