当前位置:网站首页>Get the width and height of the screen in real time (adaptive)
Get the width and height of the screen in real time (adaptive)
2022-07-02 08:00:00 【Rivers smile】
The code is almost like this , You can monitor the height and width of the screen at this time , If it changes, then Modify the length and width of the target box
export default {
name: 'page-index',
data(){
return{
windowWidth: document.documentElement.clientWidth, // Real time screen width
windowHeight: document.documentElement.clientHeight, // Real time screen height
}
},
methods: {
},
// <!-- stay watch Medium monitor real-time width and height -->
watch: {
windowHeight (val) {
let that = this;
console.log(" Real time screen height :",val, that.windowHeight );
},
windowWidth (val) {
let that = this;
console.log(" Real time screen width :",val, that.windowHeight );
}
},
mounted() {
var that = this;
// <!-- hold window.onresize The event hangs to mounted On the function -->
window.onresize = () => {
return (() => {
window.fullHeight = document.documentElement.clientHeight;
window.fullWidth = document.documentElement.clientWidth;
that.windowHeight = window.fullHeight; // high
that.windowWidth = window.fullWidth; // wide
})()
};
},
}
边栏推荐
- 【Programming】
- 利用Transformer来进行目标检测和语义分割
- Nacos service registration in the interface
- open3d学习笔记三【采样与体素化】
- 【学习笔记】反向误差传播之数值微分
- 用于类别增量学习的动态可扩展表征 -- DER
- open3d学习笔记四【表面重建】
- Real world anti sample attack against semantic segmentation
- open3d学习笔记五【RGBD融合】
- 【Wing Loss】《Wing Loss for Robust Facial Landmark Localisation with Convolutional Neural Networks》
猜你喜欢
Look for we media materials from four aspects to ensure your creative inspiration
【Hide-and-Seek】《Hide-and-Seek: A Data Augmentation Technique for Weakly-Supervised Localization xxx》
联邦学习下的数据逆向攻击 -- GradInversion
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
[mixup] mixup: Beyond Imperial Risk Minimization
Thesis writing tip2
Programmers can only be 35? The 74 year old programmer in the United States has been programming for 57 years and has not retired
Target detection for long tail distribution -- balanced group softmax
用MLP代替掉Self-Attention
【学习笔记】Matlab自编图像卷积函数
随机推荐
多站点高可用部署
【Mixed Pooling】《Mixed Pooling for Convolutional Neural Networks》
【Programming】
Daily practice (19): print binary tree from top to bottom
【Random Erasing】《Random Erasing Data Augmentation》
【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》
【双目视觉】双目立体匹配
【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
Go functions make, slice, append
用全连接层替代掉卷积 -- RepMLP
【Batch】learning notes
TimeCLR: A self-supervised contrastive learning framework for univariate time series representation
Gensim如何冻结某些词向量进行增量训练
[multimodal] clip model
解决jetson nano安装onnx错误(ERROR: Failed building wheel for onnx)总结
A brief analysis of graph pooling
I'll show you why you don't need to log in every time you use Taobao, jd.com, etc?
Hystrix dashboard cannot find hystrix Stream solution
【C#笔记】winform中保存DataGridView中的数据为Excel和CSV
【MobileNet V3】《Searching for MobileNetV3》