css鼠标移上去显示元素,移开隐藏
首页的导航要鼠标移上去显示,鼠标移动到显示的元素上也显示,移开隐藏
用了很多方法都不行
jq 的 toggle,hide show 都会出现莫名的抽搐
最终解决
导航栏和弹出元素都要加product 的class,弹出元素还加 hover-box 的class
.hover-box{ display: flex; justify-content: space-between; flex-wrap: wrap; width: 1000px; background-color: #fff; margin: 80px auto 0; height: 0; overflow: hidden; }
// 导航栏浮动 let show = true; $('.product').mouseover(function(){ $('.hover-box').css('height','auto'); }) $('.product').mouseout(function(){ $('.hover-box').css('height','0'); })

浙公网安备 33010602011771号