anam
anam

Reputation: 3913

css classes to flip image

i have use created these 2 classes to flip image .

.imgnew
{
 -webkit-transform-style:preserve-3d;
 -webkit-transition:all 1.0s linear;
 transform-style:preserve-3d;
 transition:all 1.0s linear

}

.transition
{
 -webkit-transform:rotateY(180deg);
 transform:rotateY(180deg);

}

this two css file.when user clicks on image i am adding images to this 2 class so image is flip . again to bring img back to position i a m removing these 2 classes from img , but , my problem is some time i see 3D transition effect and some time i don't see it but image is fliped.

what is the problem.???

Upvotes: 3

Views: 347

Answers (1)

Chango
Chango

Reputation: 6782

Remove only the class with the transform and it will work just fine.

I think that the problem was that you were removing the class that gave the transition to the element, so if the element doesn't have a transition it just changes, without a transition, is it clear?

Here you have a fiddle where the first image has the transition and the other doesn't: http://jsfiddle.net/EYWwu/

Upvotes: 5

Related Questions