-1
1024幅以下私はページの本文をスクロールバーのないユーザーの画面に合わせたいと思います。基本的には、1024幅以下のスクリーンブラウザ(スクロールバーなし)に合うように全身を拡大する必要があります。コンテンツは一定の再サイズの後に画面に収まる
function resizeWindow() {
$(window).off('scroll');
windowWidth = $(window).width();
console.log(windowWidth);
if (windowWidth > 1024)
{
console.log(">1024");
}else if (windowWidth <= 1024)
{
$('body').css('height', '100vh');
$('body').css('width', '100vw')
}
}
$(window).resize(resizeWindow);
CSS:
body, html {
height: 100%;
width: 100%;
}
チェックhttps://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag [メディアクエリの – apokryfos
可能な複製に十分ですモバイル?](https://stackoverflow.com/questions/6370690/media-queries-how-to-target-desktop-tablet-and-mobile) – lumio
また、あなたは本当に 'body、html ''の幅。 'body'の内部にラッパー要素を追加します。 – lumio