Создайте тайм-аут при наведении мыши и, если есть событие мыши, отмените таймаут.
let timeout;
$(".test").mouseover(function() {
timeout = window.setTimeout(() => {
$(".item").css("background", "red")
}, 5000);
});
$(".test").mouseout(function() {
window.clearTimeout(timeout);
});
div {
margin: 5px;
}
.test {
width: 100px;
height: 100px;
border: 1px solid red;
}
.item {
width: 100px;
height: 100px;
border: 1px solid black;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="test">hover me</div>
<div class="item">will change color after 5 sec</div>
Попробуйте следующее
Option Explicit
Public Sub EMail()
Application.ScreenUpdating = False
Dim OutApp As Object
Set OutApp = CreateObject("Outlook.Application")
Dim Sht As Worksheet
Set Sht = ThisWorkbook.Sheets("Sheet1")
Dim Cell As Range
For Each Cell In Sht.Range("A2", Sht.Range("A100").End(xlUp))
DoEvents
If Sht.Cells(Cell.Row, "B").Value Like "?*@?*.?*" And _
Sht.Cells(Cell.Row, "C").Value = "0" Or _
Sht.Cells(Cell.Row, "D").Value = "0" Or _
Sht.Cells(Cell.Row, "E").Value = "0" Then
Dim MissingItem As String
Select Case "0"
Case Sht.Cells(Cell.Row, "C").Value
MissingItem = "KPI's"
Case Sht.Cells(Cell.Row, "D").Value
MissingItem = "Comments"
Case Sht.Cells(Cell.Row, "E").Value
MissingItem = "Org Chart"
End Select
Dim OutMailKPI As Object
Set OutMailKPI = OutApp.CreateItem(0)
With OutMailKPI
.To = Sht.Cells(Cell.Row, "B").Value
.Subject = "Reminder"
.Body = "Dear, " & Sht.Cells(Cell.Row, "A").Value _
& vbNewLine & vbNewLine & MissingItem
.Display
End With
End If
Next Cell
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub