p {
font-size:30px;
text-align:center;
text-decoration: underline;
cursor:hand;
cursor:pointer;
}
/* The flip card container - set the width and height to whatever you want. We have added the border property to demonstrate that the flip itself goes out of the box on hover (remove perspective if you don't want the 3D effect */
.flip-card {
background-color: transparent;
perspective: 1000px; /* Remove this if you don't want the 3D effect */
margin: 0 auto;
}
.flip-card, .flip-card .cardImage {
width: 300px;
height: 417px;
}
/* This container is needed to position the front and back side */
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
text-align: center;
overflow: visible !important;
transition: transform 0.8s;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
box-shadow: 0px 0px 10px #AAA;
}
/* Position the front and back side */
.flip-card-front, .flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
}
/* Style the front side (fallback if image is missing) */
.flip-card-front {
color: black;
}
/* Style the back side */
.flip-card-back {
color: white;
transform: rotateY(180deg);
}
.cardIcon {
display:block;
position: absolute;
top: 0;
width: 50px;
cursor:pointer;
cursor:hand;
}
#helpImage {
left:0;
}
#removeCard {
right:0;
}
JavaScript
var rotate = 0;
$(document).ready(function(){
$('.draw').on('click', function(){
updateDeck();
});
$('.cardIcon').on('click', function() {
alert($(this).attr('id') + ' has been clicked!');
})
})
function updateDeck() {
rotate += 180;
$('.flip-card-inner').css('transform', 'rotateY(' + rotate + 'deg)')
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.