当光标在Raphael中的另一个图像上时,如何防止鼠标悬停事件失去对图像的关注?

时间:2015-09-09 09:20:58

标签: javascript jquery svg raphael

当鼠标悬停在大女孩图像上时,小编辑图像(铅笔图像)将出现在大女孩图像的顶部。然后当鼠标悬停铅笔图像时,大女孩图像开始失去焦点,因此铅笔图像消失。我尝试使用onmouseleave=function()但仍无法解决此问题。我试过用css z-index也无法修复这个按钮。在http://jsfiddle.net/zac1987/6o2g0c60/4/进行演示。代码:

var searchDl = 1;
var l = 0;
var r = Raphael(5, 5, 1950, 1950);
var p = r.path("M 550, 20 C 720,60 920,480 550,700").attr({stroke: "none"}),
    pt = p.getPointAtLength(l);
    e = r.image("http://2aek.com/inventory/test/1.png", pt.x, pt.y, 120, 120),

    totLen = p.getTotalLength(),

    e.node.onmouseover = function(){
        y = r.image("http://2aek.com/inventory/test/edit-button.png", pt.x, pt.y, 30, 30);
        z = r.image("http://2aek.com/inventory/test/delete-button.png", pt.x + 90, pt.y, 30, 30);
    };

    e.node.onmouseleave=function(){
        y.remove();
        z.remove();
        alert ("big-girl-image losing focus already!");
    };

小编辑图像位于大女孩形象之上。当光标在小编辑图像上时,如何使鼠标光标仍然专注于大女孩图像?

0 个答案:

没有答案