IONICページを2つの垂直セクションに分割しようとしています。最初のセクションには応答するYouTubeのiframeが保存され、2番目のセクションにはアイテムのリストが保存されます。これら2つのdivの高さの合計はページの全高でなければなりません。Ionicページを2つの垂直セクションに分割し、2番目のセクションをスクロール可能にして高さを制限します。
私はYouTubeの動画iframeを反応させることができました。今度は、アイテムDIVの高さを調整して、イオンコンテンツの高さの残りの部分(ビューページ)を取り上げる必要があります。私は成功していない様々なソリューションを試してみました!アイテムDIVの高さを調整してスクロール可能にする方法はありますか?高さを定義するとうまくスクロールしますが、高さが定義されていない場合はスクロールしません。高さを動的に計算できますか?私は本当にあなたの助けに感謝します。ありがとう。
HTML
<ion-content scroll="false">
<!-- video wrapper -->
<div class="videoDiv">
<div class="videoWrapper">
<div class="videoWrapperIframe">
<iframe width="560" height="315" src="https://www.youtube.com/embed/-v2ZDYMu1Rc" frameborder="0" allowfullscreen></iframe>
</div>
</div>
</div>
<!-- item wrapper -->
<div class="itamWrapper">
<div class="itamWrapperItem">
<ion-scroll delegate-handle="item" direction="y">
<ol class="list">
<li class="item" ng-repeat="item in items">
{{item.id}}
</li>
</ol>
</ion-scroll>
</div>
</div>
</ion-content>
CSS
.videoDiv {
display:block;
max-width: 400px;
margin-right: auto;
margin-left:auto;
}
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
background-color:#ededed;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.itamWrapper {
position: relative;
height: 100%;
display:block;
max-width: 600px;
margin-right: auto;
margin-left:auto;
background-color:red;
}
.itamWrapperItem {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
あなたはhttps://codepen.io/codingSober/pen/PjWxJy
は感謝が、これで問題が解決しません!前と同じように動作し、項目divにはスクロールしません! – limpCoder