js 动态获取高度 设置距离

var boxs = document.getElementById('m2-head');
var Height = boxs.clientHeight||o.offsetHeight;
console.log(Height)
$(".swiper-container").css({"margin-top":Height + "px"});

原文地址:https://www.cnblogs.com/guangzhou11/p/12067815.html