不会javascript,但是我想应该是先得到鼠标所在位置的X值,带到画图的函数里去,求出来的Y跟鼠标现在所在的Y相等就算是在曲线上了。顶!

解决方案 »

  1.   

    v:line 就是正常的对象了,可能有事件的
      

  2.   

    v:line是vml里面的的画线语句 被IE的DOM所支持 被支持为一个标准的元素
    v:line而且有他自己事件 onmouseover 和onmouseout
    这2个事件分别在 鼠标移到线上方时和离开线上方是触发 你只要处理一下这2个事件就可以了
      

  3.   

    gzdiablo(),我尝试把onmouseover 和onmouseout加进 v:line里面,但都不行,也许我不知道怎样使用,如果鼠标移动到曲线时,就执行 aaa(),请问怎么写?
      

  4.   

    var s='<v:line from="'+lastPoint.x+','+lastPoint.y+'" to="'+x1+','+y1+'" style="color:red;position:absolute;left:0px;top:0px;"></v:line>';
    lastPoint.x = x1;
    lastPoint.y = y1;
    points.push( {x:x1,y:y1} );
    var o=document.createElement(s);
    o.onmouseover = function(){aaa();}
    o.onmouseout = function(){bbb();}
      

  5.   

    gzdiablo(),谢谢你,请最后帮一个忙,当鼠标放在曲线上时,怎样取得其坐标?
      

  6.   

    我在网上找到如下显示坐标的,但我只要当鼠标放在曲线上时,才要坐标,请问怎么办?<script language="javascript">
    var where = ""; 
    function checkwhere(e) {
            if (document.layers){
          xCoord = e.x;
           yCoord = e.y;
    }
            else if (document.all){
            xCoord = event.clientX;
           yCoord = event.clientY;
    }
            else if (document.getElementById){
            xCoord = e.clientX;
            yCoord = e.clientY;
    }
            window.status = "X座标值= "+ xCoord + "  Y座标值= " + yCoord ;        }
    document.onmousemove = checkwhere;
    if(document.captureEvents) {document.captureEvents(Event.MOUSEMOVE);}
    </script>
      

  7.   

    触发时间的时候你在去获取鼠标坐标o.onmouseover = function(){aaa();alert(window.event.clientX + "," + window.event.clientY)}