在谷歌浏览器的设备模式下,window.innerWidth返回什么?它是设备的视口(加上任何滚动条)?
我为设备的宽度x高度(页面顶部的尺寸 - 设备的视口?)和window.innerWidth x window.innerHeight(浏览器的视口?)获得了不同的值.这应该发生吗?
这是我得到的图片和我使用的代码.

<!doctype html>
<html>
<head></head>
<body>
<script>
var image;
window.onload = function() {
image = document.getElementById("img");
checkWindowSize();
window.addEventListener('resize', function(event){
checkWindowSize();
});
}
function checkWindowSize() {
var width = window.innerWidth,
height = window.innerHeight;
console.log("window.innerHeight: ", window.innerHeight, " window.innerWidth: ", window.innerWidth);
}
</script>
<img id="img" class="vid-img-filter" src="http://i.imgur.com/jkhFJMn.jpg" alt="">
</body>
</html>
Run Code Online (Sandbox Code Playgroud)