I would like to loop through each h1 > a
element, add and then remove a class after a certain delay, but it isn't working.
What am I doing wrong?
$("h1 a").each(function() {
$(this).addClass('glow').delay(2000).removeClass('glow');
});
a {
color: #000;
text-decoration: none;
text-shadow: -1px 0px 1px rgba(150, 150, 150, 1);
}
h1 {
text-align: center;
}
.glow {
animation: glow .8s infinite alternate;
}
@keyframes glow {
to {
text-shadow: 0 0 6px #aaa;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<h1>
<a href="#">wellcome</a>,
<a href="#">bonjoure</a>,
<a href="#">bienvenido</a>,
<a href="#">benvenuto</a>,<br/>
<a href="#">добро пожаловать</a>,<br/>
<a href="#">willkommen</a>
</h1>