How to add animate.css

1

I need to use animate.css but I do not know how to include it in my html.

<link rel="stylesheet" type="text/css" href="https:/raw.github.com/daneden/animate.css/master/animate.css ">
<button class="animate flash"> myAnimatedButton </button>

Basically I want the button to load those styles. How can I use from here animate.css?

    
asked by Theia 10.07.2017 в 22:36
source

1 answer

1

Your error is that you do not let the library load first you can do the following when the sun is loaded make a change of classes to execute the animation

$(function() {
  $('button').addClass('animated rotateInDownLeft');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<button> myAnimatedButton </button>

Update

without jQuery you can use the following code:

//obteniendo el elemento que deseas animar
var elemento = document.getElementsByTagName("button")
//agregando el atributo class y sus valores
elemento[0].setAttribute("class","animated rotateInDownLeft")

//obteniendo el elemento que deseas animar
var elemento = document.getElementsByTagName("button")
//agregando el atributo class y sus valores
elemento[0].setAttribute("class","animated rotateInDownLeft")
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.2/animate.min.css">
<button> myAnimatedButton </button>
    
answered by 10.07.2017 / 23:06
source