ionic 元素高度,位置

1.可以通过document.getElementById(“attach_headerId”).scrollHeight;或者scrollWidth来获取元素的高度。
可以通过document.getElementById(“chapterId”).offsetLeft来获取上下偏移量。

如果元素不包含在中,获取偏移量的时候需要将的高度加上去。

Leave a Reply

Your email address will not be published. Required fields are marked *