在悬停时更改z-index(弹跳div)

时间:2015-10-07 05:10:09

标签: javascript jquery html css

当我将鼠标悬停在该框上时,我试图改变this code以使每个框都出现在前面。

任何建议或帮助都将不胜感激!

  [STAThread]
    static void Main()
    {
    AppDomain currentDomain = default(AppDomain);
    currentDomain = AppDomain.CurrentDomain;
    // Handler for unhandled exceptions.
    currentDomain.UnhandledException += GlobalUnhandledExceptionHandler;
    // Handler for exceptions in threads behind forms.
    System.Windows.Forms.Application.ThreadException += GlobalThreadExceptionHandler;
    ...
    }

private static void GlobalUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
{
   Exception ex = default(Exception);
   ex = (Exception)e.ExceptionObject;
   ILog log = LogManager.GetLogger(typeof(Program));
   log.Error(ex.Message + "\n" + ex.StackTrace);
}


private static void GlobalThreadExceptionHandler(object sender, System.Threading.ThreadExceptionEventArgs e)
{
   Exception ex = default(Exception);
   ex = e.Exception;
   ILog log = LogManager.GetLogger(typeof(Program)); //Log4NET
   log.Error(ex.Message + "\n" + ex.StackTrace);
}

4 个答案:

答案 0 :(得分:2)

您是否尝试过使用:hover psuedo类。

.bouncer:hover {
    z-order: 1;
}

答案 1 :(得分:2)

检查

https://jsfiddle.net/qwLpf1vr/2/

.bouncer:hover{
    z-index:1000;
    background-color:skyblue;
}

或不更改背景颜色

https://jsfiddle.net/qwLpf1vr/4/

答案 2 :(得分:2)

您可以为hover添加css .bouncer以设置其z-index

.bouncer:hover {
    z-index: 1;
}

<强> JSFIDDLE DEMO

答案 3 :(得分:0)

你也可以试试这个......

$('.bouncer').hover(function(){
    $('.bouncer').css({"z-index" : "9"});
    $(this).css({"z-index" : "999999"});
});

将此代码添加到您的脚本中..