I have some elements that I apply CSS3 Transitions to by adding a new class.
HTML
<div id="parent">
<div class="child">
</div>
</div>
CSS
.child {
background: blue;
-webkit-transition: background 4s;
-moz-transition: background 4s;
transition: background 4s;
}
.newChild {
background: red;
}
JQuery
$(".child").addClass("newChild");
When I clone an element .childbefore adding a new class, and then adding a new class, the transitions are applied immediately, not after 4sec.
Take a look at the fiddle .
source
share