Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

img usemap via JS

2 views
Skip to first unread message

LEMAIRE Mathieu

unread,
May 12, 2005, 10:25:34 AM5/12/05
to
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

Dietmar Meier

unread,
May 12, 2005, 10:40:29 AM5/12/05
to
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

LEMAIRE Mathieu

unread,
May 12, 2005, 10:43:12 AM5/12/05
to
thank you...so stupid i am !
> ciao, dhgm
--
Maz
0 new messages