I've been working on mastering the art of scheduling animations using JavaScript, in particular with the assistance of jQuery. In an attempt to create a blinking effect for some h1
tags, I noticed that the animation was not running smoothly. It would pause intermittently before continuing.
The main animation code snippet is as follows:
function animSlideHeading() {
$('.slide h1').animate({
opacity: .6
}, 500, 'swing', function() {
$('.slide h1').animate({
opacity: 1
}, 500, 'swing', animSlideHeading);
});
}
Check out this JSBin example.