1

1

解决方案 »

  1.   

    这样呢?
    <img src="http://avatar.profile.csdn.net/7/F/0/2_tiredcat888.jpg" border="0" usemap="#Map" />
    <map name="Map" id="Map"><area shape="rect" coords="0,1,53,54" href="#" /><area shape="rect" coords="77,2,121,52" href="#" /><area shape="rect" coords="5,69,45,120" href="#" /><area shape="rect" coords="82,69,121,120" href="#" /></map>
    <script>
    function $(el){
    return typeof el == 'string' ? document.getElementById(el) : el;
    }
    function $t(name, cot){
    cot = cot || document;
    return cot.getElementsByTagName(name);
    }
    var objs = $t('area', $('test'));
    for(var i = 0, len = objs.length; i < len; i++){
    objs[i].onmouseover = function(){
    alert(this.coords)
    }
    }
    </script>