Javascript Flip Box

February 14, 2023
<script> 
(function() {
    jQuery(document).ready(function() {
       jQuery('.flip-container .vc_column-inner').click(function(){
          jQuery(this).toggleClass("flip");
       });
       
    });
})(jQuery);
</script>
<div class="flip-box">
  <div class="flip-box-inner">
    <div class="flip-box-front">
      <div class="text">
      <div class="image">
<h3 style="text-align: center;">Flip Me</h3>
</div>

</div>
    </div>
    <div class="flip-box-back">
<div class="text">
      
      <p>Text here </p>

</div>
    </div>
  </div>
</div>

.flip-box {
  background-color: transparent;
  width: 100%;
  height:300px;
  perspective: 1000px;  /*Remove this if you don't want the 3D effect */
}

/* This container is needed to position the front and back side */
.flip-box-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

/* Do an horizontal flip when you move the mouse over the flip box container */
.flip-box:hover .flip-box-inner {
  transform: rotateY(180deg);
}

/* Position the front and back side */
.flip-box-front,
.flip-box-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Style the front side */
.flip-box-front {
  background-color: transparent;
  color: #fff;
}
.flip-box-front .image{
    display:block;
}
.flip-box-front .image img{
    max-height:109px;
    width:auto;
}
.flip-box-front h3{
    clear:both;
    display:block;
    width:100%;
    color:#fff;
   text-transform:capitalize;
   Padding-left:45px;
   Padding-right:45px;
}

/* Style the back side */
.flip-box-back {
  background-color: #fff;
  color: #000;
  transform: rotateY(180deg);
}
.flip-box-back .text{
    padding:55px;
    font-size:20px; line-height:30px;
    Text-align:left;

}

TAGS: nerd talk

The Shop



Handmade knit hats made from 100% baby alpaca yarn.

Interested in placing a custom order?

INQUIRE NOW

Bliss is a constant state of mind undisturbed by gain or loss.