//监听浏览器tab切换,以便在tab切换之后,页面隐藏的时候,把弹幕停止

    document.addEventListener('webkitvisibilitychange', function() {

        if (document.hidden === true) {

    //页面已隐藏

        } else {

            //页面显示

        }

    }, false);

 

 

 

可参考:

https://developer.mozilla.org/zh-CN/docs/Web/Guide/User_experience/Using_the_Page_Visibility_API

http://www.iteye.com/news/26489

http://www.zhangxinxu.com/wordpress/2012/11/page-visibility-api-introduction-extend/

http://www.cnblogs.com/lhb25/archive/2012/11/15/more-html5-apis.html

 

相关文章:

  • 2021-11-16
  • 2021-11-13
  • 2021-08-11
  • 2021-12-03
  • 2021-12-18
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2021-12-30
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案