Hi All,
This is my first post, I am so far doing exercises challeges from 100 (which is about jQuerty)
That is correct. If you were just to add class animated shake
to an element, it would normally not do anything. jQuery adds the class to the html element or removes it, jQuery does not do the animation itself. Animate.css adds css classes that you can apply to elements to animate them. You do not need jQuery to animate elements. You could manually add the class with HTML. For example, let’s look at the Animate.css source code:
@keyframes fadeOut {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
.fadeOut {
-webkit-animation-name: fadeOut;
animation-name: fadeOut;
}
Basically it defines a class called .fadeOut
that has a CSS keyframes animation. Every time you add this class to an element, via HTML or jQuery, it will do the fadeOut animation (opacity 1 to opacity 0) defined in keyframes.
Yes, if you don’t include the animate.css file in your web page, then those won’t work. They define what those mean for the browser. If you don’t include JQuery, then browser won’t know what those $ mean.
But they are easy to include in your web page:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.css"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
It’s a little confusing when you’re working through the challenges and the builds (in codepen) because you don’t really see how it all fits together and it takes care of some of these things for you. When you try to build your first page, there will be a few things you need to figure out, but you’ll pick them up quickly. Really, it’s the easiest part of building the page.
Thanks so much for your help.
I understand much better after your explanation.
Thanks so much !
I hope I will be able to build my first page soon!