![](/img/trans.png)
[英]workaround for FF5 and chrome setInterval(), setTimeout() in inactive tab
[英]mousemove focus is lost when DOM modification is initiated on FF5
演示:
http://anuary.com/dev/hp/pad3/
設想:
到達該頁面后,您會注意到手指跟隨您的 cursor。 單擊任何視頻,再次單擊該視頻。 (不要再單擊任何內容;這應該會關閉視頻) mousemove
不再響應,除非單擊文檔上的任何位置。
這是由以下行 (200) 引起的:
$.hp.ul.find('img').show();
$.hp.ul.find('li object, li div').remove();
將它們注釋掉會使一切再次正常工作。
在 OSX,FireFox 5 上發現錯誤。如果此錯誤未出現在您的操作系統/瀏覽器上,請報告。
有什么問題? 如何解決這個問題?
更新:
這似乎是一件更嚴重的事情,可能是操作系統/瀏覽器錯誤。 The thing is that when the cursor disappears and you are trying to go outside of the browser window, the cursor is still invisible. (除非你點擊某處)
感謝任何解決方法。
你可以試試:
$(document).live('mousemove', function(e){
cursor.css({
left: e.clientX-tab.offset().left-60,
top: e.clientY-tab.offset().top+15
});
});
雖然我無法在 FF5/Chrome (Win XP) 上重現這一點。 視頻不會停止(即使顯示了圖像,它也會在背景中播放)。
此外,您的實現會干擾諸如 Flashblock 之類的插件,您可能需要考慮這一點。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.