mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-06-09 00:38:00 +08:00
缩放可以实时检测是否横屏
This commit is contained in:
parent
1209acce50
commit
754edac71a
@ -16,7 +16,13 @@ const dragFnMap = new Map<DragFn, DragMap>();
|
|||||||
/**
|
/**
|
||||||
* 是否是移动设备
|
* 是否是移动设备
|
||||||
*/
|
*/
|
||||||
export const isMobile = matchMedia('(max-width: 600px)').matches;
|
export let isMobile = matchMedia('(max-width: 600px)').matches;
|
||||||
|
|
||||||
|
window.addEventListener('resize', () => {
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
isMobile = matchMedia('(max-width: 600px)').matches;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 向一个元素添加拖拽事件
|
* 向一个元素添加拖拽事件
|
||||||
|
Loading…
Reference in New Issue
Block a user