简体   繁体   English

在 FF5 上启动 DOM 修改时,mousemove 焦点丢失

[英]mousemove focus is lost when DOM modification is initiated on FF5

Demo:演示:

http://anuary.com/dev/hp/pad3/ http://anuary.com/dev/hp/pad3/

Scenario:设想:

On arrival to the page, you will notice finger following your cursor.到达该页面后,您会注意到手指跟随您的 cursor。 Click on any of the videos, click on the video again.单击任何视频,再次单击该视频。 (don't click anything anymore; this should close the video) mousemove is no longer responding unless clicked anywhere on the document. (不要再单击任何内容;这应该会关闭视频) mousemove不再响应,除非单击文档上的任何位置。

This is caused by the following lines (200):这是由以下行 (200) 引起的:

$.hp.ul.find('img').show();
$.hp.ul.find('li object, li div').remove();

Commenting them out makes everything work again.将它们注释掉会使一切再次正常工作。

Bug found on OSX, FireFox 5. Please report if this bug does not appear on your OS/browser.在 OSX,FireFox 5 上发现错误。如果此错误未出现在您的操作系统/浏览器上,请报告。

What's the problem?有什么问题? How to fix this?如何解决这个问题?

An update:更新:

This appears to be a much more serious thing and probably OS/Browser bug.这似乎是一件更严重的事情,可能是操作系统/浏览器错误。 The thing is that when the cursor disappears and you are trying to go outside of the browser window, the cursor is still invisible. The thing is that when the cursor disappears and you are trying to go outside of the browser window, the cursor is still invisible. (unless you click somewhere) (除非你点击某处)

Any workaround solutions are appreciated.感谢任何解决方法。

You can try:你可以试试:

$(document).live('mousemove', function(e){      
        cursor.css({
            left:  e.clientX-tab.offset().left-60,
            top:   e.clientY-tab.offset().top+15
        });
    });

Although I'm not able to reproduce this on FF5/Chrome (Win XP).虽然我无法在 FF5/Chrome (Win XP) 上重现这一点。 Video doesn't stop (even though the image is shown, it plays in background).视频不会停止(即使显示了图像,它也会在背景中播放)。

Also, your implementation interferes with addons like Flashblock, something you might want to consider.此外,您的实现会干扰诸如 Flashblock 之类的插件,您可能需要考虑这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM