1

I have this setup that I would like to play on repeat. I'm not great with jQuery so wondered if someone could show me how?

DEMO

$('.title1').fadeIn('fast', function() {
    $('div').addClass('animated pulse');
});

$('div').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend    
animationend', function() {
    $('.title1').fadeOut(2000);
});
4
  • stackoverflow.com/questions/4713477/… Commented Mar 24, 2014 at 16:55
  • Have a look at setInterval() Commented Mar 24, 2014 at 17:01
  • Any reason why you can't use CSS instead of the fadeOut()? You can add it to the end of your CSS animation. If you post your CSS animation code, I'd be happy to show you what I mean. Commented Mar 26, 2014 at 2:35
  • Hey thanks for your response I'd be curious to see how you suggest I achieve this with css. My slider looks like this jsfiddle.net/akZ48/5 and I'd want each title to fade in pulse and then fade out over each slide. Commented Mar 26, 2014 at 7:08

1 Answer 1

2

http://jsfiddle.net/jFIT/86KLb/7/

Just wrap it all in a function and call it from the callback of fadeOut..

 doIt();

function doIt(){
  $('.title1').fadeIn('fast', function() {
      $('div').addClass('animated pulse');
  })
  $('div').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend    animationend', function() {
    $('.title1').fadeOut(2000, function() {doIt();});
  });
};
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.