我想隐藏一个div它的屏幕尺寸大于700px,并只显示屏幕尺寸小于700像素;jquery屏幕隐藏/显示
这里是我试图与使用jQuery 3
jQuery(document).ready(function() {
if ((screen.width>701)) {
$(".mobile-section").css('display', 'none'); $(".yourClass").hide();
}elseif ((screen.width<=699)) {
$(".mobile-section").css('display', 'block');
}
});
它不工作来实现的代码---我在做什么错?
使用CSS媒体查询 – David