In javascript I want to position divs with rotations without transitions to reach a starting position for an animation (made with css transition). So after this initial position, I want to enable the transition.
I did a codepen there: http://codepen.io/3MO/pen/ZLoKbv It seems the codepen does not work will it works on my local, the window.onload is not taken into account.
Anyway : - the divs don't have any transition attribues set. - I transform the divs, according to the digit clicked. - After that, I want to start transitions, so I add a class to the divs which defines the transition properties.
function onThumbnailClick(event) {
var index = parseInt(event.target.id.split('-')[1]);
//initialize the div position without transition :
initPortraitPanel(index);
//then I "activate" the transition :
$('.portraitDiv').addClass('active-transition');
//After that I want to launch transitions...
}
.active-transition {
transition: 0.5s;
}
The problem is, the initial positioning of the divs takes the transition properties even if they are set after.
anybody can tell me a proper way to disable transition for an initial positioning, then activate the transition so this initial positioning doesn't use transition?
Thanks!