你想听听enquire.js:
enquire.register("screen and (max-width:1000px)", {
match : function() {}, // REQUIRED
// Triggered when the media query transitions
// *from an unmatched state to a matched state*
unmatch : function() {}, // OPTIONAL
// If supplied, triggered when the media query transitions
// *from a matched state to an unmatched state*.
setup : function() {}, // OPTIONAL
// If supplied, a one-time setup function
// triggered when the handler is first registered.
deferSetup : true, // OPTIONAL, defaults to false
// If set to true, defers execution the setup function until
// the media query is first matched. Setup is still triggered just once.
destroy : function() {} //OPTIONAL
// If supplied, triggered when a hander is unregistered (covered later).
// Enables you to provide lifecycle to responsive widgets.
// Put cleanup logic here.
}).listen(); // More on this next
[来自文档]
编辑:如果您想通过 js 添加纯 CSS 规则 [不依赖于侦听器],我认为这是不可能的。