判断div是否有滚动条
var obj=document.getElementById("showDiv")
if(obj.scrollHeight>obj.clientHeight||obj.offsetHeight>obj.clientHeight){
document.getElementById("hiddenDiv").style.height="15pt";
console.log('该div有滚动条!')
}
vue项目中,滚动条恢复初始位置的方法
this.$nextTick(()=>{
let dom = document.getElementById('addContent');
if(dom!==null){
dom.scrollTop = 0;
}
})