当前位置:网站首页>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
})()
};
},
}边栏推荐
- TimeCLR: A self-supervised contrastive learning framework for univariate time series representation
- 笔记本电脑卡顿问题原因
- Where do you find the materials for those articles that have read 10000?
- Real world anti sample attack against semantic segmentation
- MoCO ——Momentum Contrast for Unsupervised Visual Representation Learning
- 学习写文章格式
- 【双目视觉】双目立体匹配
- 【AutoAugment】《AutoAugment:Learning Augmentation Policies from Data》
- [Sparse to Dense] Sparse to Dense: Depth Prediction from Sparse Depth samples and a Single Image
- 浅谈深度学习模型中的后门
猜你喜欢

【Cutout】《Improved Regularization of Convolutional Neural Networks with Cutout》

I'll show you why you don't need to log in every time you use Taobao, jd.com, etc?
![Open3d learning note 3 [sampling and voxelization]](/img/71/0b2ac5dfd538017de639e5651c7f46.png)
Open3d learning note 3 [sampling and voxelization]

【MnasNet】《MnasNet:Platform-Aware Neural Architecture Search for Mobile》

Income in the first month of naked resignation
![[multimodal] clip model](/img/45/8501269190d922056ea0aad2e69fb7.png)
[multimodal] clip model

【DIoU】《Distance-IoU Loss:Faster and Better Learning for Bounding Box Regression》

Hystrix dashboard cannot find hystrix Stream solution

In the era of short video, how to ensure that works are more popular?

Real world anti sample attack against semantic segmentation
随机推荐
Network metering - transport layer
【C#笔记】winform中保存DataGridView中的数据为Excel和CSV
Using super ball embedding to enhance confrontation training
TimeCLR: A self-supervised contrastive learning framework for univariate time series representation
【雙目視覺】雙目矯正
【BiSeNet】《BiSeNet:Bilateral Segmentation Network for Real-time Semantic Segmentation》
Open3D学习笔记一【初窥门径,文件读取】
業務架構圖
应对长尾分布的目标检测 -- Balanced Group Softmax
w10升级至W11系统,黑屏但鼠标与桌面快捷方式能用,如何解决
Open3d learning notes 1 [first glimpse, file reading]
How gensim freezes some word vectors for incremental training
I'll show you why you don't need to log in every time you use Taobao, jd.com, etc?
Mmdetection trains its own data set -- export coco format of cvat annotation file and related operations
How to turn on night mode on laptop
用于类别增量学习的动态可扩展表征 -- DER
What if a new window always pops up when opening a folder on a laptop
[C # note] the data in DataGridView saved in WinForm is excel and CSV
将恶意软件嵌入到神经网络中
install.img制作方式