jquery - onclick with javascript and animate.css -
i don't why won't work.
i did animation on div class header (fadeindownbig); want when click on link (a href) header fadeoutupbig.
<script> $(function(){ $("a").click(function(){ $("#header1").addclass('animated fadeoutupbig'); }); }); </script>
.header{ margin-left:10px; height:350px; background:url(../img/background_header2.jpg); background-repeat:no-repeat; }
<div class="header animated fadeindownbig" id="header1" > <div class="menu"> <a class="wow animated fadein hvr-grow-shadow transition" data-wow-delay="0.5s" href="../index.html" >home </a>
what doing wrong ? (does not include animate.css)
like comment above mentioned clicking on anchor redirect before animations can take place. javascript can make not default action @ on click adding return false
or preventdefault
@ end.
i've made example above code.
code:
$(function() { $("a").click(function() { $("#header").addclass('animated fadeoutupbig'); return false; }); });
Comments
Post a Comment