Created
October 10, 2020 12:23
-
-
Save fhefh2015/af4fea35c9cd8d129e4382d4543cfcb5 to your computer and use it in GitHub Desktop.
获取屏幕宽度高度
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function get_screen_size() { | |
return { | |
width: window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth, | |
height: window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment