Javascript 为什么不';不能在jQuery中使用媒体查询?

Javascript 为什么不';不能在jQuery中使用媒体查询?,javascript,Javascript,我正在尝试使用jQuery进行媒体查询,但无法正常工作 if ((screen.width>=20) || (screen.width<300)){ width="190"; //Adjust the width of the image height="170"; //Adjust the height of the image } if ((screen.width>=300) || (screen.width<

我正在尝试使用jQuery进行媒体查询,但无法正常工作

    if ((screen.width>=20) || (screen.width<300)){
        width="190"; //Adjust the width of the image
        height="170"; //Adjust the height of the image
    }
    if ((screen.width>=300) || (screen.width<350)){
        width="240"; height="200";
    }
    if ((screen.width>=351) || (screen.width<400)){
        width="280"; height="220";
    }
    if ((screen.width>=401) || (screen.width<599)){
        width="320"; height="240";
    }
    if ((screen.width>=600) || (screen.width<757)){
        width="440";  height="320";
    }
    if ((screen.width>=758) || (screen.width<899)){
        width="320"; height="240";
    }
如果((screen.width>=20)|(screen.width=300)|(screen.width=351)|(screen.width=401)|(screen.width=600)|(screen.width=758)|(screen.width这是您想要的吗

    if ((window.innerWidth>=20) || (window.innerWidth<300)){
        width="190"; //Adjust the width of the image
        height="170"; //Adjust the height of the image
    }
    if ((window.innerWidth>=300) || (window.innerWidth<350)){
        width="240"; height="200";
    }
    if ((window.innerWidth>=351) || (window.innerWidth<400)){
        width="280"; height="220";
    }
    if ((window.innerWidth>=401) || (window.innerWidth<599)){
        width="320"; height="240";
    }
    if ((window.innerWidth>=600) || (window.innerWidth<757)){
        width="440";  height="320";
    }
    if ((window.innerWidth>=758) || (window.innerWidth<899)){
        width="320"; height="240";
    }

如果((window.innerWidth>=20)| |(window.innerWidth=300)| |(window.innerWidth=351)| |(window.innerWidth=401)| |(window.innerWidth=600)|(window.innerWidth=758)| |(window.innerWidth
屏幕是什么
?它从哪里来的?你是指
$(window.width()
$(window.height())高度()
?什么是
screen
screen
是jQuery对象吗?插件是什么?如果您正在寻找jQuery/Javascript可以评估的媒体查询,请使用Modernizer插件的mq()方法:@RocketHazmat当然,它存在,但是
:)
您发布的内容与jQuery没有任何关系