vue在頁面嵌入別的頁面或者是視頻2


 vue在頁面嵌入別的頁面或者是視頻

以下是嵌入頁面

<iframe name="myiframe" id="myrame" src="http://xxx.com/" frameborder="0" align="left" width="100%" height="100%"  scrolling="auto" marginWidth=0 marginHeight=0 class="iframesty" onload="changeFrameHeight()">
   <p class="tip">你的瀏覽器不支持iframe標簽</p>
</iframe>

 

scrolling="auto"=》可以滾動
scrolling="no"=》不可以滾動
onload="changeFrameHeight()=》根據適配的font-size大小改變初始化時候的高度
在index.html頁面寫js
window.addEventListener("orientationchange", resetrem);
      window.addEventListener("resize",resetrem);
      function resetrem(){
          var fs = parseInt(document.querySelector("html").style.fontSize)
          return fs
      }
      function changeFrameHeight(){
          var fs = resetrem()
          var ifm = document.getElementById('myrame');
          ifm.height = document.documentElement.clientHeight - fs-6
      }

 

嵌入視頻

<div class="toast" :class="{tshow:toastshow}" style="width:90%;height:300px">
     <iframe frameborder="0" :src="this.video_url" allowFullScreen="true" style="width:100%;height:300px" ></iframe>
</div>
<div :class="{mask:maskshow}" @click="hidden_video" @touchmove.prevent></div>

 




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM