2

Is it possible to get some param target value (for example height) of css3 transition element before animation ends.

For example we have div with css

div {height: 300px;}

This div has height transition css

Then we create class

div.big {height: 450px;}

And then we run jQuery code:

var height = $('div').addClass('big').height();

How to make height variable to be 450, not 300 or 301px as it just beginned changing its height?

I would avoid removing its transition css as it would cause flickr.

Adam Pietrasiak
  • 12,773
  • 9
  • 78
  • 91
  • are you wanting to know when the transition has ended? there is transitionend event (with browser prefixes) but seems unpredictable in my experience. http://stackoverflow.com/questions/2794148/css3-transition-events – CodeToad Jun 12 '13 at 15:27

1 Answers1

0

try this:

var height = $('div').addClass('big')[0].style.height;
vaclav_o
  • 1,705
  • 3
  • 15
  • 24