I have implemented a CSS map pin with some CSS3 animations. You can check it out here:
https://jsfiddle.net/xg7xfzeq/
body {
background: #e6e6e6;
}
.pin {
width: 30px;
height: 30px;
border-radius: 50% 50% 50% 0;
background: #00cae9;
position: absolute;
transform: rotate(-45deg);
left: 50%;
top: 50%;
margin: -20px 0 0 -20px;
}
.pin:after {
content: "";
width: 14px;
height: 14px;
margin: 8px 0 0 8px;
background: #e6e6e6;
position: absolute;
border-radius: 50%;
}
.bounce {
animation-name: bounce;
animation-fill-mode: both;
animation-duration: 1s;
}
.pulse {
background: #d6d4d4;
...
<div class='myBounceDiv'>
<div class='pin bounce'></div>
<div class='pulse'></div>
</div>
I'm looking to add a bounce CSS3 animation on click, but I want it to animate only once. Changing the CSS class on click causes the animation to loop endlessly. One solution I considered was using a timer to revert the class after a set time, but this interfered with the initial appearance animation. Is there a way to achieve this using pure JavaScript and CSS, similar to the animation shown here: triggered on click?