|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hey there,
I want to create this effect: I make an Image map with hotspots (I know how to do this), and when the user goes over one of those hotspots, in another cell a discription should appear (I don't know how to do this). I don't know much about JavaScript, but I think that's the language I should use to get this effect? Can somebody please help? I already had a go on this, which resulted in the code below. Maybe you people can find where I got wrong, as the effect isn't working with this. Or should I just try a totally different thing? Quote:
Any help would be greatly appreciated, livinus |
|
#2
|
|||
|
|||
|
You look as if you are trying to do something I have had some success with on my website:
http://myweb.tiscali.co.uk/spiresgat...Web/2alpha.htm If you put the cursor over the nose of a student then a larger version appears at top right and a contemporary version may appear below it. In addition the student's name will be seen as a yellow sticker. If you click on the face when the sticker appears the you will get further information either as an alert or as a full page in a new window. This is done using hot spots as you have set it up. You could probably use my code to replace the lower school badge with a block of descriptive text. I must confess that I arrived at my solution by blundering around a bit and it may not be very elegant but perhaps it will give you some ideas. I might even use your code to clean mine up in places. |
|
#3
|
|||
|
|||
|
It's something like this I'm looking for, but instead of the zoomed-in version on the right, I'd like to have the name there. So no alternative text that brings the name under the cursor when you stay for some time on somebody's head. Your code indeed looks quite difficult to me. And by the way, the code I posted really isn't working properly, so I guess copying it for your site isn't quite a good idea
...Can anybody solve my problem
|
|
#4
|
|||
|
|||
|
Pay attention to the browsers error messages, the 'function' keywords are missing in your code. Btw, you don't need the onmouseout for each area, you can use the map's onmouseout handler:
Code:
function showdiscription(id){
var descriptionStyle = document.getElementById("discription" + id).style;
descriptionStyle.display = "block";
document.getElementById("Map").onmouseout = function () {
descriptionStyle.display = "none";
this.onmouseout = null;
}
};
__________________
Stop thinking, start drinking. |
|
#5
|
|||
|
|||
|
Thanks, this was of great help. I changed the old code with yours and now it's working fine!
Leaving out the onmouseout for each area worked too! Thanks a lot! |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|