zoukankan      html  css  js  c++  java
  • document 屏幕自适应设置

    <script>
    var getPercent = function () {
    var percent = '25%';
    if (window.innerWidth < 1280) {
    percent = '24.9%';
    } else if (window.innerWidth <= 1440) {
    percent = '19.9%';
    } else if (window.innerWidth <= 1600) {
    percent = '16.6%';
    } else {
    percent = '14%';
    }
    return percent;
    }
    window.onresize = function () {
    $('.ratio-patient-1').css("width", getPercent());
    }//监听窗口变化
    document.write('<style>.ratio-patient-1{' + getPercent() + ' ;}</style>');//自适应宽度
    document.write('<style>.tag-1{background:' + BingZhongColor + ' ;}</style>');//病重颜色
    </script>

  • 相关阅读:
    C语言I博客作业09
    C语言I博客作业08
    14
    13
    12
    11
    10
    9
    8
    7
  • 原文地址:https://www.cnblogs.com/benbenjia/p/9559853.html
Copyright © 2011-2022 走看看