小程式video置頂
阿新 • • 發佈:2018-11-11
page { overflow-y: none; height: 100vh; } .page__hd_media { position: fixed; width:100vw; top:0; height: 30vh; z-index: 999; text-align: center; } video { width: 100vw; height: 100%; } .page__bd_media { box-sizing: border-box; height: 70vh; line-height: 2; position: fixed; bottom: 0; }
<view class="page" > <view class="page__hd_media"> <video src="{{video.videoUrl}}" bindplay="bindplay" bindtimeupdate="bindtimeupdate" bindpause="bindpause" bindended="bindended" id="{{video.id}}" initial-time="{{currentTime}}"></video> </view> <scroll-viewclass="page__bd_media" scroll-y> //頁面內容 </scroll-view> </view>
直接在video標籤 position: fixed;top: 0; 不好使video還是會隨著頁面滑動