zoukankan      html  css  js  c++  java
  • vue iframe嵌套页面高度自适应 (ios 宽度扩大的bug , ios展示比例问题)

    <template>
      <div class="card-index pt-relative">
        <div id="wrapper" :style="'height:'+Height+'px;'">
          <iframe
            v-if="iframeType"
            :src="srcUrl"
            sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation allow-modals"
            id="iframe"
            marginwidth="0"
            marginheight="0"
            align="center"
          ></iframe>
          <iframe
            v-else
            :src="srcUrl"
            sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation allow-modals"
            id="iframe"
            scrolling="no"
            marginwidth="0"
            marginheight="0"
            align="center"
          ></iframe>
       
        </div>
      </div>
    </template>
     
     
     data() {
        return {
          srcUrl: "",
          iframeType: false
        };
      },
     created() {
     var u = navigator.userAgent;
        var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
        // var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
        // console.log('是否是Android:'+isAndroid);
        // console.log('是否是iOS:'+isiOS);
        if (isAndroid) {
          this.iframeType = true;
        } else {
          this.iframeType = false;
        }
    }

    <style lang='scss' scoped>
    .card-index /deep/ {
       100%;
      position: relative;
      #iframe {
         100%;
        height: 100%;
        overflow: scroll;
        -webkit-overflow-scrolling: touch;
        min- 100%;
        * 100%;
         1px;
      }

      #wrapper {
        -webkit-overflow-scrolling: touch;
        overflow: auto;
        position: fixed;
        right: 0;
        left: 0;
        top: 0;
        bottom: 0;
         100%;
        height: 100%;
      }
     
    </style>
  • 相关阅读:
    Oracle数据库系统结构二(实例结构)
    Oracle数据库系统结构一(存储结构)
    SQL Plus的使用详解(登录和常用命令)
    Oracle的基本了解和配置
    Oracle11g的安装及删除
    C++编译预处理
    C++程序的多文件组织
    C++变量的存储类型
    C++动态存储方式与静态存储方式
    C++函数五(局部变量与全局变量和域运算符)
  • 原文地址:https://www.cnblogs.com/FACESCORE/p/11990919.html
Copyright © 2011-2022 走看看