Skip to content
provide the event deal with page [hidden](deactive) or [visible](active), written by PURE JS.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
PageVisibilityEvent.js
README.md

README.md

JS-PageVisibilityEvent

provide the event deal with page hidden/deactive or visible/active, written by PURE JS, Cross-browser Support.

Current browser support

  • Chrome 13+
  • Internet Explorer 10+
  • Firefox 10+
  • Opera 12.10+

Example

  var pv = new PageVisibilityEvent();   //New a Instance
  pv.SetCallback(visibilityChange);     //To Set (or Rest) a Callback
  pv.Disable();                         //To Disable
  pv.Enable();                          //To Re-Enable
  pv.GetIsAtivceNow();                  //Return current status

  function visibilityChange(isActive){
     //isActive equal TRUE  means active;
     //isActive equal FALSE means deactive;
  }

licenses

MIT licenses :)

You can’t perform that action at this time.