I try to implement a CSS3 list menu with animation on each item. On page load, this is an hidden menu and the animation starts on click on the button with "#trigger-overlay" ID. There's a cross to close the menu and I would like to start again the animation on new click on the button with "#trigger-overlay" ID. I think there's a piece of code missing, probably something to do with style.webkitAnimationPlayState but I don't know how. Any help ?
Here's my code :
$( "#trigger-overlay" ).click(function() {
$("ul#menu-main-menu li").each(function (i) {
$(this).attr("style", "-webkit-animation-delay:" + i * 300 + "ms;"
+ "-moz-animation-delay:" + i * 300 + "ms;"
+ "-o-animation-delay:" + i * 300 + "ms;"
+ "animation-delay:" + i * 300 + "ms;");
if (i == $("ul#menu-main-menu li").size() -1) {
$("ul#menu-main-menu").addClass("play")
}
});