I'd like to get the native screen width on a device to append scripts in the DOM. Is it possible using jQuery ?
Thanks
window.screen.width
? Source: https://developer.mozilla.org/en-US/docs/DOM/window.screen
Sure. You can get the basic width and height using:
screen.width;
screen.height;
If required, you can also get the pixel ratio (useful if you need to also detect retina displays) by using:
window.devicePixelRatio
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With