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