473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

img usemap via JS

I wanna change the usemap of an image with JS.. how to do it ?
Here's what I've tried (doesn't work) :

<img src='contenu.jpg' alt='' name='contenu' usemap='#map1'/>

<map name="map1"><area shape="rect" coords="0,0,20,20" href="#" /></map>
<map name="map2"><area shape="rect" coords="200,20,40,40" href="#" />
</map>

<a href='#' onclick="document['contenu'].usemap='map2';" >map2</a>
<a href='#' onclick="document['contenu'].usemap='map1';" >map1</a>

thank you

--
Maz
Jul 23 '05 #1
2 2615
LEMAIRE Mathieu wrote:
<map [...] href="#" /></map>
<map [...] href="#"></map>
<a href='#' onclick="document['contenu'].usemap='map2';" >map2</a>
<a href='#' onclick="document['contenu'].usemap='map1';" >map1</a>


<a href='#' onclick="document.images['contenu'].useMap='#map2'">map2</a>
<a href='#' onclick="document.images['contenu'].useMap='#map1'">map1</a>

ciao, dhgm
Jul 23 '05 #2
thank you...so stupid i am !
ciao, dhgm

--
Maz
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Robert | last post by:
Hi! I'm reading in the html spec that the INPUT element can have a "ismap" or a "usemap" attribute, and thus that an image map can be associated with a form. I've searched but didn't find any...
2
by: Luciano \(DOC\) | last post by:
I change an image using a map by rolling over a button. The point is I have to change the map as well. I tried this way: document.images.usemap = "#" + NewMap; but it seems not to wrok. Do...
0
by: Jeronimo Bertran | last post by:
Hi, I have a page that includes an image that uses an image map. When the user clicks on a button, the image needs to be refreshed and the map needs to be updated without refreshing the entire...
1
by: Arne | last post by:
I am try to convert a classic ASP program to ASP.Net. I have an <img> tag that I want to convert to <asp:image>. The <img> has an attribute called usemap. I can't find the corresponding attribute...
0
by: Demetri | last post by:
I have a problem: I have an image that I need to display and if a user clicks anywhere on the image I need the coordinates. So I am using an ImageButton, which is good, works great for capturing...
1
by: Paul E Collins | last post by:
I'm confused about valid values for the IMG element's USEMAP attribute. According to this specification, "the value of usemap must match the value of the name attribute of the associated MAP...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.