html tab页面切换事件。

$(document).bind("visibilitychange",function(e){
  //只对tab页面切换有效

  //document.visibilityState === 'visible' OR 'hidden'
})

$(window).bind("focus",function(e){

// tab页面,浏览器和程序切换都有效果
});

posted @ 2016-06-28 16:16  winenr123  阅读(2669)  评论(0编辑  收藏  举报