Bruno
Bruno

Reputation: 1055

Create an animation on wordpress site

I am creating an animation on the main wordpress page. To do this I am doing as follows:

$(document).ready(function(){
   
   (function mover(i){
      
      $('#seta').animate({top: (i ? "-" : "+")+"100px"}, 1000, function(){
         mover(!i);
      });
      
   }())
   
});
#seta{
   position: relative;
}
.container img {
    max-width: 200px;
    max-height:250px;
    width: auto;
    height: auto;
}
.container {
    clear: both;
    margin-top: 20px;
}
img {
    vertical-align: top
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div id="seta" class="container">

<a href="http://xxxxxxxxx.xx/recrutamento/"><img src="http://xxxxxxxxxxx.xx/wp-content/uploads/small.png" width="320" height="205" /></a>
<h1>Procura Emprego! Clique aqui!</h1>
</div>

I've tested it and it works, but I can't get it to work on my site.

I show in the image how I am doing: enter image description here

But I get this error on the page as shown in the image: enter image description here

Upvotes: 0

Views: 116

Answers (1)

red
red

Reputation: 1619

As you can see there are some <p> tags in your code, and you can't paste the code directly inside the editor.

In the visual composer (click on backend editor) you can find a module for code, search for javascript and paste only the js code or for html and paste the code inside the <script> tag.

Upvotes: 2

Related Questions