get-client-window-width
Version:
A safe way of returning the interior width of the window in pixels
16 lines (12 loc) • 418 B
JavaScript
var isSupported = function isSupported() {
return typeof window !== 'undefined';
};
var getClientWindowWidth = function getClientWindowWidth() {
if (!isSupported()) {
return 0;
}
return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
};
export default getClientWindowWidth;
export { getClientWindowWidth };
//# sourceMappingURL=get-client-window-width.esm.js.map