[js]
Posted 武卡卡的个人博客
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[js]相关的知识,希望对你有一定的参考价值。
var cards = document.querySelectorAll(".card"); for (let index = 0; index < cards.length; index++) { const card = cards[index]; card.addEventListener("mouseover",function(){ var chils = this.childNodes for (let i = 0; i < chils.length; i++) { let e = chils[i]; if(e.nodeType==1 && e.classList.contains(\'card-info\')){ e.classList.remove("fontDown"); e.classList.add("fontUp"); } } },false) card.addEventListener("mouseout",function(){ var chils = this.childNodes for (let i = 0; i < chils.length; i++) { let e = chils[i]; if(e.nodeType==1 && e.classList.contains(\'card-info\')){ e.classList.remove("fontUp"); e.classList.add("fontDown"); } } },false) }
以上是关于[js]的主要内容,如果未能解决你的问题,请参考以下文章