0

I am using animation.css and jquery to create a slideInleft animation so that content comes in and stays and then slideOutleft and then I want content to come in from right I mean slideInright and stay for few secs and then slideOutRIght. This effect should happen continuously. I am trying this but something is wrong . To start off with the left animation I have written code like this

var txt = Data;
    function AnimateOneByOne()
    {   
        if( xCnt < txt.length && txt[xCnt].value){
        $("#value").empty().append(txt[xCnt].value.toFixed(2)+" "+txt[xCnt].units).addClass('slideInLeft',

          function(){ AnimateOneByOne() });
        $("#text").empty().append(txt[xCnt].name).addClass('slideInLeft',

          function(){ AnimateOneByOne() });
        }
        xCnt += 1; 
    }

    AnimateOneByOne();

1 Answer 1

1

Make sure you have on the element you want to animate both the animation general class: "animated" the class of specific animation, like: "slideInLeft". So in the end it will look like this:

'<div class="animated slideInLeft">I am animated</div>
You can do this easily with "addClass", if you already using jQuery.

 $(this).addClass('animated ' + animationName);

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.