Can't get addClass to work with JQuery


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.



<script src=""></script>
$(document).ready(function() {
      $('#cross').addClass('animated hinge')


  position: relative;
  left: 350px;
  height: 425px;
  width: 550px;
  z-index: 1;

#cross {
  position: relative;
  right: 125px;
  z-index: 2;


<h1>My Tribute to Matt Dillahunty</h1>

<img src='//' alt="Picture of Matt Dillahunty" class="center rounded" id="matt"></img>

<img src="" alt="gold cross collapsing" width="300px" height="450px" id="cross"</img>

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


Make sure you add the animate.css library in between your <head> and </head> tags.

<link rel="stylesheet" href="">

Thank you!! You are very kind :slight_smile:

Just to clarify…

The addClass was adding the class “animated hinge”, but since you did not have the animate.css library added, nothing was happening.

1 Like

Thanks. it works on my case.
jQuery animation doesn’t work for HTML files.

It “seems” to be working in this sample… thanks for helping

Pnr Status 192.168.l.l