gpt4 book ai didi

jquery - Firefox 中的 .fadeOut()

转载 作者:行者123 更新时间:2023-12-01 03:37:33 26 4
gpt4 key购买 nike

我在我的元素中添加了一个 fadeOut() 函数,当我检查该元素时,我实际上看到不透明度的数字减少了,当它们达到 0 时,该元素只是消失,而不是慢慢淡出。如果这是一个 FF 错误?

这是我的代码

setTimeout(function () {  
$('#myEm').toggleClass('in').delay('3000').fadeOut('slow', function() {
$(this).remove();
});
}, 100);

JSFIDDLE

最佳答案

问题是由转换引起的。解决方案非常简单。

#myEm {
top:-100px;
z-index: 99999;
overflow: hidden;
position: fixed;
white-space: nowrap;
margin-left: 45%;
margin-right:50%;
transition: top 1s ease; /*only animate the top and not all*/
-webkit-transition: top 1s ease; /*this is so that is will also work on google chrome*/
}

here你有一个可以工作的 fiddle 。 (我删除了延迟只是为了快速显示)

关于jquery - Firefox 中的 .fadeOut(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29927257/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com