Skip to content
Advertisement

Tag: media-queries

Javascript media queries not working in safari / iOS

Hope someone can help. The following lines of code work in everything except Safari. Has anyone else discovered how to get Safari to recognise / process these queries? Any and all help gratefully received. Answer Safari does not support resolution, though it looks like the relevant bug has been fixed so it’ll come out at some point in a Safari

Replacement for deprecated MediaQueryList.addListener() method

The Mozilla Developers Network docs say MediaQueryList.addListener() is deprecated. Though it’s working in my (Angular 8) code, the linting in VS Code is warning about deprecation. What’s the replacement for MediaQueryList.addListener()? Answer Quoting from the MDN docs about MediaQueryList: MediaQueryList.addListener() Adds a listener to the MediaQueryListener that will run a custom callback function in response to the media query status

Advertisement