:悬停状态在 jQuery UI“剪辑”之后不会恢复动画 - IE Bug

发布于 2025-01-02 18:10:31 字数 422 浏览 2 评论 0原文

在 IE(所有版本)中发现一个错误,想知道是否有解决方法。

这是使用 jsfiddle 以非常简单的形式出现的错误:

http://jsfiddle.net/9frpL/6/

在 Internet Explorer 中:

  1. 单击“显示”
  2. 单击“隐藏”
  3. 再次单击“显示”

注意到“隐藏”链接仍然处于悬停状态吗?有时,如果在元素动画时移动鼠标足够快,则不会发生这种情况。

“盲目”UI 动画或基本的 slipUp() 方法不会发生此错误,但“剪辑”UI 动画确实是我正在处理的项目所需要的。

感谢您的浏览,希望对您有所帮助!

Found a bug in IE (all versions), wondering if there is a workaround.

This is the bug in a very simple form using jsfiddle:

http://jsfiddle.net/9frpL/6/

In Internet Explorer:

  1. Click "show"
  2. Click "hide"
  3. Click "show" again

Notice how the "hide" link is still in its hovered state? Sometimes it doesn't happen if you move your mouse fast enough while the element is animating.

This bug doesn't happen with the "blind" UI animation or the basic slideUp() method, but the "clip" UI animation is really what I need for the project I'm working on.

Thanks for taking a look, hope you can help!

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

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

发布评论

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

评论(1

作死小能手 2025-01-09 18:10:31

编辑:请检查下面的,更丑陋的黑客,DEMO 这里

$("#hide").bind('click', function(e) {

    $("#box").hide('clip', 'fast', function () {
        $('#hide').addClass('ieHax');    
    });
    e.preventDefault();

});

$('#hide').bind ('mouseenter', function (e) {
    $('#hide').removeClass('ieHax');
});

和CSS:

a.ieHax {
    color: #000 !important;
}

原始 Ans:

我能想到的一个快速技巧是在 .hide 回调中将颜色设置为 #000

$("#box").hide('clip', 'fast', function () {
    $('#hide').css('color', '#000'); /* Hax for IE */
});

请注意,这不是一个正确的解决方案。

Edit: Please check the below, even more uglier hack, DEMO here

$("#hide").bind('click', function(e) {

    $("#box").hide('clip', 'fast', function () {
        $('#hide').addClass('ieHax');    
    });
    e.preventDefault();

});

$('#hide').bind ('mouseenter', function (e) {
    $('#hide').removeClass('ieHax');
});

and CSS:

a.ieHax {
    color: #000 !important;
}

Original Ans:

One quick hack I could think of is to set the color to #000 in .hide callback,

$("#box").hide('clip', 'fast', function () {
    $('#hide').css('color', '#000'); /* Hax for IE */
});

Pleas note that this is not a proper solution.

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