javascript - How does jq get the browser status, whether it is zoomed in the taskbar, and whether it is on the current page
阿神
阿神 2017-05-19 10:24:55
0
2
559

How does jq get the browser status and whether it is reduced to the taskbar

I want to make an H5 desktop notification, but I want it to wait until the browser is reduced to the taskbar. If it is in the expanded state, it cannot be triggered.

I don’t know if jq can do it, because I saw the web version of WeChat and smartqq are like this, but I don’t know if js can do it

阿神
阿神

闭关修行中......

reply all(2)
刘奇

First determine whether it is in the current window

if(window.document.hidden){ 
    //new Notification 
}
Ty80

Isn’t it enough to just look at the source code?
http://pub.idqqimg.com/smartq...
The core code is this sentence:

function isDocumentHidden(){
    return doc.hidden || doc.mozHidden || doc.webkitHidden;
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template