Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery easing vs CSS3 transition - Is there an exact equivalent smoothing?

I am using jQuery animate together with CSS3 transition.

The problem is I couldn't find an equivalent smoothing animation. Is there any?

The closest I got is this (jQuery easeOutQuad and CSS3 default easing).

CSS:

#div1 { transition: width 0.5s; }

jQuery:

$('#div2').animate({'width': 200}, 500, 'easeOutQuad');

http://jsfiddle.net/bzw4q/

But they are still different.

I want both to animate together at the same time (using any good easing algorithm). Is that possible?

like image 818
Aximili Avatar asked Jul 09 '13 07:07

Aximili


People also ask

What is ease in transition CSS?

ease-in - specifies a transition effect with a slow start. ease-out - specifies a transition effect with a slow end. ease-in-out - specifies a transition effect with a slow start and end.

What is the difference between ease in and ease out in animation?

In classic animation, the term for motion that starts slowly and accelerates is "slow in," and for motion that starts quickly and decelerates is "slow out." The terminology most commonly used on the web for these are “ease in” and “ease out,” respectively.

How to stop transition in JavaScript?

To pause an element's transition, use getComputedStyle and getPropertyValue at the point in the transition you want to pause it. Then set those CSS properties of that element equal to those values you just got.


1 Answers

Try with swing and ease-in-out > http://jsfiddle.net/et6Hg/

I think you have better chances :)

like image 187
Ussama Dahnin Avatar answered Oct 10 '22 10:10

Ussama Dahnin