-1
繼承人我目前有我的代碼:不確定的,如果IM調用元素孩子正確這裏
var divArray = ["test", "love"]
var delayArray = ["delaya", "delayb", "delayc", "delayd", "delaye", "delayf", "delayg", "delayh", "delayi", "delayj", "delayk", "delayl", "delaym", "delaya", "delayb", "delayc", "delayd", "delaye", "delayf", "delayg", "delayh", "delayi", "delayj", "delayk", "delayl", "delaym"];
function zip(a, b, f) {
for(var i=0; i < a.length; i++){
f(a[i], b[i]);
};
}
function phase(){
var divGroup = this.children();
for(var i=0; i < divGroup.length; i++){
this.children()[i].className = 'wave ' + delayArray[Math.floor(Math.random()*26)];
}
}
for(var i = 0; i < divArray.length; i++) {
document.getElementById(divArray[i]).addEventListener('animationend', phase, false);
}
zip(divArray, delayArray, function(x, y) {
document.getElementById(x).className = 'transtart burn ' + y;
});
而且繼承人什麼我試着去完成的jsfiddle:http://jsfiddle.net/ACLM6/1/
相當多,我想這兩個新要添加到animationend
觸發元素的子元素的類。但林不知道我是否在phase()
正確調用元素的孩子。
什麼是'divGroup'? –
@Jack它是一個我沒有列出的全局變量。我最初的問題是,如果我正確地調用了元素的子元素。對不起,我忘了包括它。 – JSArrakis