fullpage.jsを使って、1ページものの制作をしています。
ボタンをクリックすることで、モーダルを表示させてPC時は全体に、モバイル時は横スクロールさせようとしていたら、chromeのデベロッパーツールではスクロールできますが(マウスでの横スクロールです)、実機のiPhoneで検証したところスクロールができませんでした。
下記内容を参考に、autoScrolling:falseにしてもできずでした。
■fullpage.jsでautoScrolling: true(デフォルト)の際、モバイルだとモーダルウインドウ表示で、スクロールできない。overflow-y: scrollがきかない
https://teratail.com/questions/69149
モーダル表示でモバイル時に横スクロールをさせたいのですが、どうすればよいでしょうか?
よろしくお願いします。
html
1<div ontouchstart="" class="wrapper"> 2 <header id="header" class="header"> 3 header 4 </header> 5 <div id="container"> 6 <div class="section brand"> 7 hogehoge 8 </div> 9 <div class="section message"> 10 hogehoge 11 </div> 12 <div class="section message02"> 13 <div class="message__container"> 14 <div class="message__containerInner"> 15 <div class="message__containerInnerBlock"> 16 <a href="#modal" class="link modal-link"> 17 <p>モーダルボタン</p> 18 <span></span> 19 </a> 20 </div> 21 </div> 22 </div> 23 </div> 24 <div class="section gallery"> 25 hogehoge 26 </div> 27 <div class="section cast"> 28 hogehoge 29 </div> 30 <div class="section"> 31 <footer class="footer"> 32 footer 33 </footer> 34 </div> 35 </div> 36</div> 37<div class="remodal process" data-remodal-id="modal" role="dialog" aria-labelledby="modal1Title" aria-describedby="modal1Desc"> 38 <div class="process__container"> 39 <div class="process__containerInner"> 40 <button data-remodal-action="close" class="remodal-close" aria-label="Close"></button> 41 <div class="process__containerInnerBlock"> 42 <div class="process__containerInnerBlockFig"> 43 <figure> 44 <img src="../img/fig_top.svg" alt="hogehoge"> 45 </figure> 46 </div> 47 </div> 48 </div> 49 </div> 50</div>
scss
1.process{ 2 &__container{ 3 width: 100%; 4 //height: 100vh; 5 padding: 40px; 6 7 &Inner{ 8 position: relative; 9 display: flex; 10 justify-content: center; 11 align-items: center; 12 width: 100%; 13 height: 100%; 14 15 &Block{ 16 max-width: 1200px; 17 width: 100%; 18 height: auto; 19 20 &Fig{ 21 width: 100%; 22 23 @include mq(sm){ //mixinを作り、メディアクエリで'screen and (max-width: 667px)'を指定しています。 24 overflow-x: scroll; 25 overflow-scrolling: touch; 26 27 figure{ 28 width: 800px; 29 } 30 } 31 } 32 } 33 } 34 } 35} 36
あなたの回答
tips
プレビュー