js 动态获取高度 设置距离

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

posted @ 2019-12-19 14:57  1点  阅读(1561)  评论(0编辑  收藏  举报