在 FF5 上启动 DOM 修改时,鼠标移动焦点丢失

发布于 2024-11-24 03:10:01 字数 592 浏览 4 评论 0原文

演示:

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

场景:

到达时进入该页面,您会注意到手指跟随光标。单击任意视频,再次单击该视频。 (不要再单击任何内容;这应该关闭视频)除非单击文档上的任意位置,否则 mousemove 不再响应。

这是由以下几行 (200) 引起的:

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

将它们注释掉会使一切再次正常工作。

在 OSX、FireFox 5 上发现错误。如果此错误未出现在您的操作系统/浏览器上,请报告。

有什么问题吗?如何解决这个问题?

更新:

这似乎是一个更严重的事情,可能是操作系统/浏览器错误。问题是,当光标消失并且您试图走出浏览器窗口时,光标仍然不可见。 (除非您点击某处)

任何解决方案都将受到赞赏。

Demo:

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

Scenario:

On arrival to the page, you will notice finger following your 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.

This is caused by the following lines (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.

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. (unless you click somewhere)

Any workaround solutions are appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

匿名的好友 2024-12-01 03:10:02

你可以尝试:

$(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 等插件,您可能需要考虑这一点。

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). 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文