项目启动报错,但重新保存js文件又可以运行toggleDetails() { var item = document.getElementsByClassName('list-wrapper'); var next = document.getElementsByClassName('ico-next'); var divcard = document.getElementsByClassName('divcard'); for (var i = 0; i < item.length; i++) {
item[i].index = i;
item[i].onclick = function () { var num = this.index; if (divcard[num].style.display === 'block') {
next[num].style.transform = 'rotate(0)';
divcard[num].style.display = 'none';
} else {
next[num].style.transform = 'rotate(90deg)';
divcard[num].style.display = 'block';
}
}
}
}
添加回答
举报
0/150
提交
取消