Move active element loses mouseout event in Internet Explorer

后端 未结 4 900
小蘑菇
小蘑菇 2020-12-10 03:31

In a library I am using I have the task of moving an element to the front of the dom when it is hovered over. (I make it bigger so I need to see it, then shrink it back when

4条回答
  •  醉话见心
    2020-12-10 04:11

    That's wonky, and seems to be IE-only (but so is VML). If the parent element has a height specified, you can attach the mouseout handler to the parent... but it sounds like that won't work in your situation. Your best alternative is to use mouseover on adjacent elements to hide it:

    $(function()
    {
        $("li").mouseover(function()
        {
            $("li").css("border-color", "black");
            $(this).css("border-color", "red");
            this.parentNode.appendChild(this);
        });
    });
    

    Or SVG. You can use z-index in SVG.

提交回复
热议问题