Site URL: https://www.interaction-ld.com/coaching
Hi - I have added some code to create a flip effect that I was sent. It seems that the hover action does not quite work on touchscreen even though it has the code that should make it work ok.
If you click on the cards (on any device) it takes you to the top of the screen - can I add .on-click to behave the same as hover in this code? I tried adding it in and the cards just disappeared.
It also does not render very well on Tablets - I'd like to enforce a 2-column layout as at the moment it overlaps the cards and I cannot quite get it to do that. Example HTML below.
<a href="#">
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front"><h3>Executive</br>development</h3><p>Structured coaching for senior leaders using highly qualified, executive coaches</p>
</div>
<div class="back">
<p><strong>You can expect:</strong></p>
<ul>
<li>that the correct coach is matched for optimum chemistry and rapport</li>
<li>far-reaching, transformational behavioural change</li>
<li>coaching conversations focused on tangible actions</li>
</ul></div>
</div>
</div>
</a>
.flip-container {perspective: 1000px; transform-style: preserve-3d;}
.flip-container:hover .back {transform: rotateY(0deg);}
.flip-container:hover .front {transform: rotateY(180deg);}
.flip-container, .front, .back {
width: 324px;
height: 245px;
margin: 0px;
float: left;
}
.flipper {transition: 0.6s; transform-style: preserve-3d; position: relative;}
/* hide back of pane during swap */
.front, .back {
backface-visibility: hidden;
transition: 0.6s;
transform-style: preserve-3d;
position: absolute;
top: 0;
left: 0;
}
.front {z-index: 2; transform: rotateY(0deg);}
.back {
transform: rotateY(-180deg);
background: #F0F0F0;
color: #00000 ;
text-align:left;
p{padding-left:10px;padding-top:6px;}
ul{padding-left:30px;}
line-height:1.23em;
}
.vertical.flip-container {position: relative;}
.vertical .back { transform: rotateX(180deg);}
.vertical.flip-container:hover .back {transform: rotateX(0deg);}
.vertical.flip-container:hover .front {transform: rotateX(180deg);}
.front {background:#F0F0F0; color:#000000; text-align:left; h3{ color: #CE0058 !important; padding-left:10px; padding-top:6px;}
p{ padding-left: 10px; }}
<a href="#">
<div class="flip-container" ontouchstart="this.classList.toggle('hover');">
<div class="flipper">
<div class="front"><h3>Executive</br>development</h3><p>Structured coaching for senior leaders using highly qualified, executive coaches</p>
</div>
<div class="back">
<p><strong>You can expect:</strong></p>
<ul>
<li>that the correct coach is matched for optimum chemistry and rapport</li>
<li>far-reaching, transformational behavioural change</li>
<li>coaching conversations focused on tangible actions</li>
</ul></div>
</div>
</div>
</a>