欢迎看看用纯粹JS作的Web制图工具,
支持任意多边行/任意曲线的制作地址:www.crossgo.com

解决方案 »

  1.   

    试一试onmouseenter和onmouseleave事件,也是处理鼠标进入和离开的
      

  2.   

    问题应该出在显示的那个档住了下面的,就立刻执行了out事件
      

  3.   

    是这个意思吗?<html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>背景示例</title>
    <style>
    v\:* { behavior: url(#default#VML);} 
    </style>
    </head>
    <body>
    <v:shape style="z-index:50;width:1;height:1;position:absolute;filter='alpha(style=1,opacity=0)'" onmouseover="this.style.filter=''" onmouseout="this.style.filter='alpha(style=1,opacity=0)'" coordsize="1,1" filled="t" fillcolor="#ffffff" strokecolor="blue" path="m 28,385 l 532,463,596,49,113,28,28,385 e">
    <v:fill angle=150 type='gradient' color2="669900"/>
    </v:shape>
    </body>
    </html>
      

  4.   

    <html xmlns:v="urn:schemas-microsoft-com:vml">
    <head>
    <title>背景示例</title>
    <style>
    v\:* { behavior: url(#default#VML);}
    </style><script>
    function addShape() {
    var v = document.createElement("v:shape");
    v.id = "shp_vml";
    v.style.zIndex = 50;
    v.style.width = 1;
    v.style.height = 1;
    v.style.top = "0px";
    v.style.left = "0px";
    v.style.position = "absolute";
    v.coordsize = "1,1";
    v.filled = "t";
    v.fillcolor="#ffff00";
    v.strokecolor="blur";
    v.path="m 28,385 l 532,463,190,223,596,49,113,28,28,385 e";//alert(document.getElementByID("shp_vml"));
    document.body.appendChild(v);
    }
    function mk_div1(){//alert(shp_vml);
    var obj = document.getElementById("shp_vml");
    if(obj){
    obj.style.display = 'block';
    }}
    function hide_div1(){
    /*
    if(shp_vml){
    document.body.removeChild(shp_vml);
    }else{
    v = document.getElementByID("shp_vml");
    //v.style.display = "none";
    document.body.removeChild(v);
    }
    */
    //if(!document.getElementByID("shp_vml")){
    //document.body.removeChild(shp_vml);
    //}
    var obj = document.getElementById("shp_vml");
    if(obj){
    obj.style.display = 'none';
    }
    }
    </script>
    </head><body onload="addShape()"><div><img src="Image/guide.gif" width="710" height="528" border="1" usemap="#Map" />
    <map name="Map" id="Map">
    <area shape="poly" coords="28,385,532,463,190,223,596,49,113,28" onMouseOver="mk_div1()" onMouseOut="hide_div1()" alt="javascript:alert('hello')" />
    <!--
    <area shape="poly" coords="596,49,657,157,672,402,532,462,190,223" onMouseOver="mk_div2()" onMouseOut="hide_div2()" alt="hello222" />
    -->
    </map>
    </div><!--
    <v:shape style="z-index:50;width:1;height:1;position:absolute" coordsize="1,1" filled="t" fillcolor="#ffffff" strokecolor="blue" path="m 28,385 l 532,463,596,49,113,28,28,385 e">
    <v:fill angle=150 type='gradient' color2="669900"/>
    </v:shape>
    -->
    <v:line style="z-index:5;position:absolute;left:200;top:200" to="0,150" strokecolor="red" strokeweight="10px">
    <v:Stroke dashstyle="shortdot" endarrow='classic'/>
    </v:line></body>
    </html>