darasion
V2EX  ›  问与答

ie中,mouseover的时候css闪烁的问题。

  •  
  •   darasion · Jul 25, 2011 · 5331 views
    This topic created in 5408 days ago, the information mentioned may be changed or developed.
    代码大概是这样

    $('.item').mouseover(function(){

    $(this).addClass('hover');

    }).mouseout(function(){

    $(this).removeClass('hover');

    });

    hover里定义边框变色


    <li class="item">
    一堆div
    </li>


    期望是,当鼠标经过时,li边框变色。

    但是实际情况是,鼠标经过的时候在IE里边经常闪烁,这个问题怎样才能解决呢?
    2 replies    1970-01-01 08:00:00 +08:00
    wctbok
        1
    wctbok  
       Jul 25, 2011
    jQuery下有mouseleave和mouseenter解决ie的事件冒泡问题。
    darasion
        2
    darasion  
    OP
       Jul 25, 2011
    @wctbok 哎呀多谢。多谢多谢。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2631 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 15:49 · PVG 23:49 · LAX 08:49 · JFK 11:49
    ♥ Do have faith in what you're doing.