通过js设置样式
if(document.getElementById("B").style.display == 'none'){ document.getElementById("B").style.display = "flex" document.getElementById("B").style['align-items'] ="center" document.getElementById("B").style['justify-content'] ="center" }else{ document.getElementById("B").style.display = "none" } $('.banner-nav li').eq(i).addClass('hover').siblings('li').removeClass('hover');