0

这是我的两个媒体查询

@media screen and (min-width:1240px) and (min-height:800px)

@media screen and (min-width:1400px) and (min-height:900px)

我正在使用 Enquire.js 来匹配我的媒体查询

enquire
.register("screen and (min-width:1240px) and (min-height:800px)", {
    match: function() {
        console.log('1240px');
    },
    unmatch: function() {
        console.log('<1240px');
    },
})
.register("screen and (min-width:1400px) and (min-height:900px)", {
    match: function() {
        console.log('1400px');

    },
    unmatch: function() {
        console.log('<1400px');
    });

问题是如果我从screen and (min-width:1400px) and (min-height:900px)to screen and (min-width:1240px) and (min-height:800px), equire.js 将不匹配screen and (min-width:1240px) and (min-height:800px),这会产生问题。我尝试使用 unmatch 来解决这个问题,但是如果我screen and (min-width:1400px) and (min-height:900px)从小于screen and (min-width:1240px) and (min-height:800px). 任何人有任何解决方案?

4

0 回答 0