问题描述
我有通知 div(divNotify)
包含一些信息和主页中的计时器
Hi i have notification div(divNotify)
with some information and a timer in masterpage
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
将在某段时间内显示。
这里我需要当用户最小化浏览器时,他会通过闪烁浏览器通知他并改变颜色浏览器
divNotify
will display in some interval of time.
here i need when the user will minimize the browser he will be notified by blinking browser and change color of browser
但首先我如何知道浏览器是否在javasript中最小化
这里我使用jquery for show div tag
but first of all how do i know if the browser is minimized or not in javasripthere i am using jquery for show div tag
function Show_NotifyDiv() {
$("#div_NotificationOuter").show(1000);
$("#div_NotificationOuter").animate({ bottom: '+=30px' }, 4000);
}
推荐答案
无法确定是否该页面通过JavaScript 最小化,但您可以使用 ,以确定该网页是否可见。
Its impossible to find out whether the page is minimized via JavaScript, but you can use Visibility API to determine, whether the page is visible to user or not.
目前可在Chrome,Mozilla和IE10中使用。
Currently available in Chrome, Mozilla and IE10.
- https://developer.mozilla.org/en/DOM/Using_the_Page_Visibility_API
- http://code.google.com/chrome/whitepapers/pagevisibility.html
- http://www.nczonline.net/blog/2011/08/09/introduction-to-the-page-visibility-api/
这篇关于如何在javascript中最小化浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!