![](/img/trans.png)
[英]i have tried to pause video in html when user switch browser tab and when come back on that tab video play again automatically from where it stopped
[英]Reload the page when I switch to another tab and come back
我使用了下面的Javascript代码。
$(window).focus(function () {
window.location.reload(true);
});
在focus
事件中被称为。 但是,只要我切换或单击其他应用程序或桌面选项卡,它就会开始重新加载。 我只需要在切换选项卡时才重新加载它,而不是在单击浏览器以外的其他位置时才重新加载它。
请参阅Arthik,如果我的理解是正确的-您需要为TAB控件输入OR或提供一些ID,然后将代码修改为:
$(#tabID).focus(function () {
window.location.reload(true);
});
tabID-是您的Tab控件的ID(或DIV-您正在使用的)
如果输入错误-请更新您的查询,以便我们更好地理解
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.