View Full Version : Swap Image

03-06-2009, 07:59 PM
Sinking fast in a mire of ineptitude.
I have progressed from my earlier problem but now am stuck.
I have a table with 7 rows and two columns. Each td has a small image and some wording. Each image is named A1, A2, A3 etc. I have a second table with two tds One with a clear image, the second is a container named 'detail'

The idea is when the mouse passes over a small image, then a 'different' image appears in the 'clear image' td and some html appears in the 'detail' container. This appears to be working. When the mouse leaves the small image, the other image and the detail stays in view. This is just perfect. My problem is if a user clicks the mouse on a small image.

In IE7 a "file download' message opens and ask is I want to open or save the file.
In Firefox 3.06, a new tab opens and the 'different' image shows in the tab.
In Opera 10 the same thing happens but the image is in a different position.

I want nothing to happen if the user clicks on the small image.
My behaviours are:-
On mouse over - Swap Image
On mouse over - Set text to container
On mouse out - Set image restore
On mouse Click - set text to container (which contains no text and therefore shows an empty container) I put the action to 'on mouse click' rather than on mouse out because if I set to on mouse out the text clears - as I would expect it too..

Any idea what I should do to stop the errant behaviour?


03-08-2009, 01:45 AM
could you post the code that you are using on the thumbnail images.

I personally prefer actions like this to happen on mouse click rather than mouse over. I just think this provides a better user experience.

03-08-2009, 06:15 PM
<td width="275">
<a href="Images-stations/adv_Offset figure 8.jpg">
<img src="Images/transparent.jpg" alt="image for link"
name="A30" width="8" height="20" border="0"
usemap="#Map" id="A30"
onClick="MM_setTextOfLayer('verbiage','',' ')" onMouseOver="MM_swapImage('photoarea','','Images-stations/adv_Offset figure 8.jpg','A30','','Images-stations/adv_Offset figure 8.jpg',1);
MM_setTextOfLayer('verbiage','','This exercise blah blah blah')" onMouseOut="MM_swapImgRestore()"></a>
30. Offset Figure 8</td>

Here is the code for one of the td's. The other s are the same except for the references.



03-08-2009, 09:39 PM
If I change the text to On Click or on mouse down, the image immediately goes to the behaviour previously described.

FYI I am using Windows XP with Dreamweaver CS4 - just in case that might me relevant.


03-09-2009, 02:23 PM
Why did you make the image a link if you don't want the user to click on it?

03-09-2009, 03:07 PM
I made the image an image map - is this not the way to go?? How else can I get the behaviour that I want?

I would much prefer just to have the text in the td but could not find a way to make the behaviours - show image and reveal html to happen.


03-09-2009, 03:32 PM
How else can I get the behaviour that I want?
1. Select *any* element, image or text.
2. Select a behavior

03-10-2009, 03:40 PM
Now that is just too easy for words - duh.

Thanks for all the help - the more I know the more I know I need to know more.