Pregunta

I added the backface-visibility property to the face of the card but in FireFox it still shows the back side of the card. Seen here: http://jsfiddle.net/AZSLB/

Here's my css:

   .flip {
    -webkit-perspective: 800;
    -moz-perspective: 800;
    -ms-perspective: 800;
    perspective: 800;
    position: relative;
}

.flip .card.flipped {
    -webkit-transform: rotatey(-180deg);
    -moz-transform: rotatey(-180deg);
    -ms-transform: rotatey(-180deg);
    -o-transform: rotatey(-180deg);
    transform: rotatey(-180deg);
}

.flip .card {
    width: 100%;
    height: 100%;

    -webkit-transform-style: preserve-3d;
    -moz-transform-style: preserve-3d;
    -ms-transform-style: preserve-3d;
    transform-style: preserve-3d;

    -webkit-transition: 0.5s;
    -moz-transition: 0.5s;
    -ms-transition: 0.5s;
    -o-transition: 0.5s;
    transition: 0.5s;
}

.flip .card .face {
    width: 100%;
    height: 100%;
    position: absolute;
    z-index: 2;
    text-align: center;

    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
}

.flip .card .front {
    position: absolute;
    z-index: 1;
    color: white;
    cursor: pointer;
}

.flip .card .back {
    -webkit-transform: rotatey(-180deg);
    background: #FFF url("<?php echo $dirUrl; ?>/assets/img/photo-bg.jpg");
    color: #222;
    cursor: pointer;
}

.flip .card .back p {
    font-size: 15px;
    padding: 10px 20px;

    position: absolute;
    height: auto;
    width: auto;
    top: 50%;
    left: 0;
    -webkit-transform: translate(0%, -50%);
    -moz-transform: translate(0%, -50%);
    -ms-transform: translate(0%, -50%);
    -o-transform: translate(0%, -50%);
    transform: translate(0%, -50%);
}

Any ideas? Thanks!

¿Fue útil?

Solución

This style

.flip .card .back {
    -webkit-transform: rotatey(-180deg);
    background: #FFF url("<?php echo $dirUrl; ?>/assets/img/photo-bg.jpg");
    color: #222;
    cursor: pointer;
}

is missing the un-prefixed transform

Otros consejos

Try adding "z-index: 2" to the backside div like so:

.flip .card .back {
-webkit-transform: rotatey(-180deg);
background: #FFF url("<?php echo $dirUrl; ?>/assets/img/photo-bg.jpg");
color: #222;
cursor: pointer;
z-index: 2;
}

This ensures that the backside of the "card" is on top of the front side.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top