problem description
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)
window.onload = function () {
var hdList = $(".hd-list")[0],
hdLi = $(".hd-list>li");
hdList.onmouseover = function(e){
var ev = e || window.event,
target = ev.target || ev.srcElement,
tagName = target.nodeName.toLowerCase();
if(tagName!="ul"){
while (target.nodeName.toLowerCase()!="li"){
target = target.parentNode;
}
clearBlankNodes(target);
var childNodes = target.childNodes;
childNodes[0].classList.add("green-text");
if(childNodes.length>1){
childNodes[1].classList.remove("dis-hide");
}
}
}
hdList.onmouseout = function(e){
var ev = e || window.event,
target = ev.target || ev.srcElement,
tagName = target.nodeName.toLowerCase();
if(tagName!="ul"){
while (target.nodeName.toLowerCase()!="li"){
target = target.parentNode;
}
clearBlankNodes(target);
var childNodes = target.childNodes;
childNodes[0].classList.remove("green-text");
if(childNodes.length>1){
childNodes[1].classList.add("dis-hide");
}
}
}
}