linking a mouseover and onclick event to an image map

Discussion in 'Javascript' started by WindAndWaves, Dec 10, 2004.

  1. WindAndWaves

    WindAndWaves Guest

    Hi Folk

    I have an image map (map of New Zealand with various areas defined using an
    image map). Now I am wondering if it is possible to link this "image map"
    to an onclick and onmouseover event.

    Any ideas?

    - TIA

    Nicolaas
     
    WindAndWaves, Dec 10, 2004
    #1
    1. Advertisements

  2. WindAndWaves

    McKirahan Guest

    Try this; watch for word-wrap.

    <html>
    <head>
    <title>NZ.htm</title>
    <script type="text/javascript">
    function nz(i,j) {
    var one = new Array("onmouseover","onmouseout","onclick");
    var two = new Array("North Island","South Island");
    window.status = one + " of " + two[j];
    }
    </script>
    </head>
    <body bgcolor="#000000">
    <img src="http://www.travelplanner.co.nz/driving/images/nz2.gif" border="0"
    alt="" usemap="#NZ">
    <map name="NZ">
    <area shape="circle" coords="318,83,83" onmouseover="nz(0,0)"
    onmouseout="nz(1,0)" onclick="nz(2,0)">
    <area shape="circle" coords="252,247,92" onmouseover="nz(0,1)"
    onmouseout="nz(1,1)" onclick="nz(2,1)">
    </map>
    </body>
    </html>


    Credit for source of NZ map:

    New Zealand travel map & driving distance calculator
    http://discovernz.co.nz/driving/smlcalc.html
    http://www.travelplanner.co.nz/driving/smlcalc.html
    http://www.travelplanner.co.nz/driving/images/nz2.gif
     
    McKirahan, Dec 10, 2004
    #2
    1. Advertisements

  3. WindAndWaves

    WindAndWaves Guest


    Yes, that map is AMAZING, probably slightly outside of my budget / time /
    expertise unfortunately. My guestimate would be that it would costs at
    least U$1000 to put together something like this. Would this be right?

    Thank you for your response

    - Nicolaas
     
    WindAndWaves, Dec 10, 2004
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.