Let's dive in!
matchMedia which will listen for a specific value and trigger when true. For example:
var mediaQuery = window.matchMedia('(min-width: 768px)');
When we add a listener to the variable it can run a function:
This opens the possibility of passing any function to the listener and only having that function run on certain screen widths.
matchMedia function is widely supported, including full support for Internet Explorer 10 and 11.
Today’s Tuesday Tips was adapted from a post on Daily Dev Tips.
Want to know more? Head to fewdaily.com for more of today’s topics and other front-end web content! If you liked what you heard be sure to rate, review, and subscribe on your platform of choice. That's all for today, tune in tomorrow!