vue - 获取元素相对页面的高度
2020-08-10 •
1 条评论
let keyboardDiv = document.getElementsByClassName('keyboard-container')[0];
let keyboard_offsetTop = keyboardDiv.offsetTop;
console.log('键盘高度:' + keyboard_offsetTop);
let wHeight = +keyboard_offsetTop + 270;
let signId = item.signId;
let inputId = 'input-' + signId;
let inputDiv = document.getElementById(inputId);
let ref = this.$refs[inputId][0];
let input_top = ref.$el.getBoundingClientRect().top;