Event triggered when switching from b page tab to a page tab
欧阳克
欧阳克 2017-06-08 11:03:13
0
2
1063

Maybe there are multiple tab pages opened in the browser. How to get the event when the user switches back to the specified page, such as the tab of page a? And execute the specified js?

欧阳克
欧阳克

温故而知新,可以为师矣。 博客:www.ouyangke.com

reply all(2)
世界只因有你

1. If it is a Chrome plug-in, there is a related API

2. Your own web page. You can try focus event

window.addEventListener('focus', function () {});
给我你的怀抱

Click to switch, and then switch the page. At this time, there are two event attributes, the onunload and onbeforeunload events will be called,

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template