I'd like to randomize the duration of a given animation every page refresh. I've been trying it with jquery, but it doesn't seem to be working: I have that doesn't seem to be working.
Relevant css:
#background1 {
-webkit-animation: background1 10s;
}
Animation background1 is defined elsewhere; I'm not trying to change the keyframe animation part.
Jquery:
var bg1 = $('#background1');
var number = Math.floor(Math.random() * 10) + 5;
bg1.css('-webkit-animation', 'background1 ' + number + 's');
Nothing seems to happen. Help out a jquery noob?