Answer the question
In order to leave comments, you need to log in
How to take out the value of X and check if it is greater than 1200?
There is a code that displays the value of the custom screen extension when executed.
var x = 0;
window.addEventListener("resize", function() {
document.getElementById('widthInner').innerHTML = window.innerWidth;
x = window.innerWidth;
}, false);
<span id="width">0</span>
Answer the question
In order to leave comments, you need to log in
window.addEventListener("resize", function() {
x = window.innerWidth;
return x > 1200 ? alert('complete') : false;
}, false);
https://www.npmjs.com/package/js-media-query
Subscribe to the event and do your thing.
You can see in the source code what and where it comes from.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question