When in google chrome\'s device mode, what does window.innerWidth return? Is it the viewport of the device (plus any scroll bars)?
I\'m getting different values for
copy and paste your code and run... As you can see the pictures, It operates normally....