Hello,
Please help! I can’t get the addClass() method to work in JQuery with the code below. What is weird is that if I replace addClass() with fadeOut() the fadeOut method works. What am I doing wrong? Why doesn’t addClass work? Sorry for the poor formatting. I don’t know how this works.
Thanks.
JQuery
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('#cross').addClass('animated hinge')
});
CSS
#matt
{
position: relative;
left: 350px;
height: 425px;
width: 550px;
z-index: 1;
}
#cross {
position: relative;
right: 125px;
z-index: 2;
}
HTML
</head>
<h1>My Tribute to Matt Dillahunty</h1>
<div>
<img src='//cdck-file-uploads-global.s3.dualstack.us-west-2.amazonaws.com/freecodecamp/original/3X/7/4/74e7eeadea078af6523e1bdaf48474ddd8ec8f69.png' alt="Picture of Matt Dillahunty" class="center rounded" id="matt"></img>
<img src="http://moziru.com/images/religion-clipart-gold-cross-8.gif" alt="gold cross collapsing" width="300px" height="450px" id="cross"</img>
</div>