cdub cdub - 1 year ago 91
jQuery Question

Using CSS3 transforms to flip (rotate and scale) a block

I have to div boxes:

<div class="front"></div>
<div class="back"></div>

I then have CSS like so:

.back:hover {
transform: scale(2) rotateX(0deg);

.front:hover {
transform: rotateX(180deg) scale(1);

So I need the transform to flip the divs which it does fine on its own. But how do I scale it to 2x after the flip?

Answer Source

I suggest keyframes

@keyframes scaleUp {
        Transform: scale(2) rotate(0);
        Transform: scale(2) rotate(180deg);
.front {
    animation: scaleUp 1s forwards;

Or atleast something in that direction

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download