本文介绍了CSS过渡等效于jQuery fadeIn(),fadeOut(),fadeTo()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个


So, instead of $('#header_text1').fadeOut(250);, you'd use in your CSS:

-webkit-transition: opacity 250ms ease-in-out;
-moz-transition: opacity 250ms ease-in-out;
-o-transition: opacity 250ms ease-in-out;
transition: opacity 250ms ease-in-out;

,然后在您的JS中,

$('#header_text1').css({'opacity', 0});

如果要在发生动画时运行某些内容,则有可能触发过渡事件.

If you want to run something when an animation has happened, there are events for transitionEnd that fire.

这是完全不同的方法,但是人们已经尝试通过以下几种方式在JS和CSS之间架起桥梁:

It's quite a different approach, but people have tried to bridge between JS and CSS in a few ways:

http://playground.benbarnett.net/jquery-animate-enhanced/是一个很好的链接.

这篇关于CSS过渡等效于jQuery fadeIn(),fadeOut(),fadeTo()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 08:45