Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery CSS Keyframing

Trying to make a simple repeated keyframed animation with jQuery

$(document).ready(function() {
    $('body').mouseover(function() {
        var animateloop = 0;

        $(this).mouseout(function(){
            animateloop++;
        });

        while (animateloop !== 1) {
            $(this).delay(40).css(
                'font-family':'Homestead'
            ).delay(40).css(
                'font-family':'Arvo'
            );
        }
    });
});

I thought this code above would work, but I don't understand jQuery all that much so I can't make it work.

You can see this a JSFIDDLE here:

http://jsfiddle.net/JamesKyle/nPVxb/

like image 262
James Kyle Avatar asked Apr 27 '26 08:04

James Kyle


1 Answers

one error first:

$(this).delay(40).css(
   'font-family':'Homestead'
)

the colon:

$(this).delay(40).css(
   'font-family','Homestead'
)
like image 161
island205 Avatar answered Apr 28 '26 23:04

island205