img usemap via JS

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • LEMAIRE Mathieu

    #1

    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.jp g' alt='' name='contenu' usemap='#map1'/>

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

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

    thank you

    --
    Maz
  • Dietmar Meier

    #2
    Re: img usemap via JS

    LEMAIRE Mathieu wrote:
    [color=blue]
    > <map [...] href="#" /></map>[/color]

    <map [...] href="#"></map>
    [color=blue]
    > <a href='#' onclick="docume nt['contenu'].usemap='map2'; " >map2</a>
    > <a href='#' onclick="docume nt['contenu'].usemap='map1'; " >map1</a>[/color]

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

    ciao, dhgm

    Comment

    • LEMAIRE Mathieu

      #3
      Re: img usemap via JS

      thank you...so stupid i am ![color=blue]
      > ciao, dhgm[/color]
      --
      Maz

      Comment

      Working...