So I am using the Animate.css library here is the link if you dont know what iam talking about https://github.com/daneden/animate.css
so I want this: <h1><a id="Header" class="Header">My First Heading</a></h1>
to become this when I click it: <h1><a id="Header" class="Header animated shake">My First Heading</a></h1>
Now it is working in chrome and firefox for me but the animation is not happening. in other words I got it to change but the shaking is not happening.
HTML:
<body>
<h1><a id="Header" class="Header">My First Heading</a></h1>
<p>My first paragraph.</p>
</div>
</body>
CSS
#Header{
-webkit-animation-duration: 3s;
-webkit-animation-delay: 2s;
-moz-animation-duration: 3s;
-moz-animation-delay: 2s;
-o-animation-duration: 3s;
-o-animation-delay: 2s;
animation-duration: 3s ;
animation-delay: 2s;
}
JQuery
$(function(){
var animationName = 'animated shake';
var animationEnd = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';
$('h1').on('click',function(){
$('#Header').addClass(animationName).one(animationEnd,function(){
$(this).removeClass(animationName);
});
});
});
I am new to jsfiddle so things might not be set up right. here is my jsfiddle demo https://jsfiddle.net/Demonwing103/7sc7zagq/21/
so ultimately I don't know why its not shaking even though its changing to this: <h1><a id="Header" class="Header animated shake">My First Heading</a></h1>