var boxs = document.getElementById(‘m2-head‘);var Height = boxs.clientHeight||o.offsetHeight;console.log(Height)$(".swiper-container").css({"margin-top":Height + "px"});
js 动态获取高度 设置距离
原文:https://www.cnblogs.com/guangzhou11/p/12067815.html