![](/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.