【问题标题】:Button text blurring when hovering over an icon将鼠标悬停在图标上时按钮文本模糊
【发布时间】:2016-08-22 10:25:56
【问题描述】:

我已经让纸质计划的图标在悬停时晃动。但是,下方按钮上的文本也有点模糊。我尝试删除动画,当您将鼠标悬停在图标上时文本仍然模糊(尽管图标没有做任何事情)。

动画的CSS:

.fa-shake {
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }

  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%, 60% {
    transform: translate3d(4px, 0, 0);
  }
}

jQuery:

$('.plane').hover(function() {
    $(this).addClass('fa-shake');
}, function () {
    $(this).removeClass('fa-shake');
});

Full code 如果需要。

【问题讨论】:

    标签: javascript jquery css


    【解决方案1】:

    我会将抖动添加到图标中……而不是整个 div。

    $('.plane').hover(function() {
        $(this).find('i').addClass('fa-shake');
    }, function () {
        $(this).find('i').removeClass('fa-shake');
    });
    

    这似乎解决了问题 - Codepen

    【讨论】:

    • 它仍然存在于我的 chrome 中。
    猜你喜欢
    • 2012-08-21
    • 1970-01-01
    • 2013-09-18
    • 1970-01-01
    • 2015-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多