参考:
https://www.jianshu.com/p/9e3e56fcdc5d
https://blog.csdn.net/Ling201509/article/details/51719712/
https://blog.csdn.net/qq_35217902/article/details/105757429
等比例缩放
在rfb.js中的 _resize: function(width, height) 方法中添加以下代码(亲测无效)
this._display.autoscale(540,192,1);
screen自适应宽高(亲测有效)
#自适应宽高
function changeMobsfIframe(){
const mobsf = document.getElementById('screen');
const deviceWidth = document.body.clientWidth;
const deviceHeight = document.body.clientHeight;
mobsf.style.width = 100 + '%'; //数字是页面布局宽度差值
mobsf.style.height = (Number(deviceHeight)-109) + 'px'; //数字是页面布局高度差
}
changeMobsfIframe()
window.onresize = function(){
changeMobsfIframe()
}