tr display none crashes ie9

前端 未结 4 1197
无人及你
无人及你 2020-12-17 23:47

This code crashes ie9 as i am having this problem in my code .. any work around will be appreciated .. This is not a problem with the previous versions of ie .. Thanks ..

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-18 00:30

    There is a bug in IE9, but the css rule is logically undecidable :

    As soon as it isn't displayed any more, your mouse isn't hovering any more so it must be visible again. Which means the mouse is over it. Which means it must be hidden... which means it must be visible... etc.

    Said otherwise : the specification doesn't make sense.

    This being said, this bug is really annoying as the following code crashes IE9 too :

    $(window).ready(function(){
        $('#secondtr').mouseenter(function(){
             $('#secondtr').hide();
        });
    });
    

    But it doesn't happen if you put your event handler on a span (for example). So I suggest you change your HTML in order to avoid hidding the tr on which you have a hovering detection.

提交回复
热议问题