Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I want to flip div onclick of div.
please refer
http://www.houseofblouse.com/design/sweetheart-5[^]
Posted
Comments
Sergey Alexandrovich Kryukov 5-Oct-15 8:29am    
What do you think is "flipping div" in that example?
—SA
Richard Deeming 5-Oct-15 9:28am    
Posting links to random websites looks like spam.

And if that's your site, you desperately need to fix the viewstate, which is currently 1.5Mb!

You can do this like:

CSS
CSS
.panel {
    margin: 0 auto;
    width: 130px;
    height: 130px;
    position: relative;
    font-size: .8em;
    -webkit-perspective: 600px;
    -moz-perspective: 600px;
}
/* -- make sure to declare a default for every property that you want animated -- */

/* -- general styles, including Y axis rotation -- */
 .panel .front {
    position: absolute;
    top: 0;
    z-index: 900;
    width: inherit;
    height: inherit;
    text-align: center;
    -webkit-transform: rotateX(0deg) rotateY(0deg);
    -webkit-transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    -moz-transform: rotateX(0deg) rotateY(0deg);
    -moz-transform-style: preserve-3d;
    -moz-backface-visibility: hidden;
    /* -- transition is the magic sauce for animation -- */
    -o-transition: all .4s ease-in-out;
    -ms-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
    -webkit-transition: all .4s ease-in-out;
    transition: all .4s ease-in-out;
}
.panel.flip .front {
    z-index: 900;
    -webkit-transform: rotateY(180deg);
    -moz-transform: rotateY(180deg);
}
.panel .back {
    position: absolute;
    top: 0;
    z-index: 800;
    width: inherit;
    height: inherit;
    -webkit-transform: rotateY(-180deg);
    -webkit-transform-style: preserve-3d;
    -webkit-backface-visibility: hidden;
    -moz-transform: rotateY(-180deg);
    -moz-transform-style: preserve-3d;
    -moz-backface-visibility: hidden;
    /* -- transition is the magic sauce for animation -- */
    -o-transition: all .4s ease-in-out;
    -ms-transition: all .4s ease-in-out;
    -moz-transition: all .4s ease-in-out;
    -webkit-transition: all .4s ease-in-out;
    transition: all .4s ease-in-out;
}
.panel.flip .back {
    z-index: 1000;
    -webkit-transform: rotateX(0deg) rotateY(0deg);
    -moz-transform: rotateX(0deg) rotateY(0deg);
}


Fiddle[^]

Credit: How to flip a div with css3 and jQuery[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900