作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
您好,我有通知div(divNotify)
,其中包含一些信息和母版页中的计时器
Protected Sub Timer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Try
Me.GetNotification_Stats()
ScriptManager.RegisterClientScriptBlock(Me.Page, GetType(String), "Alert", "Show_NotifyDiv();", True)
Catch ex As Exception
Me.lblError.Visible = True
Me.lblError.InnerText = ex.Message
End Try
End Sub
divNotify
将在一定时间间隔内显示。
在这里,我需要当用户最小化浏览器时,他将通过闪烁浏览器并更改浏览器颜色来通知
但首先我如何知道浏览器是否在javasript中最小化这里我使用 jquery 来显示 div 标签
function Show_NotifyDiv() {
$("#div_NotificationOuter").show(1000);
$("#div_NotificationOuter").animate({ bottom: '+=30px' }, 4000);
}
最佳答案
通过 JavaScript 不可能查明页面是否最小化,但您可以使用 Visibility API 确定该页面是否对用户可见。
目前可在 Chrome、Mozilla 和 IE10 中使用。
关于javascript - 如何在 JavaScript 中知道浏览器已最小化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31940295/
我是一名优秀的程序员,十分优秀!