zoukankan      html  css  js  c++  java
  • rem.js reset.css 换公司的时候方便找

    "use strict";
    var win = window;
    win.resize = {};

    var timer = null;
    var rem = 12;
    var doc = win.document;
    var docEl = doc.documentElement;

    /**
    * 刷新页面REM值
    */
    function refreshRem() {
    var width = docEl.getBoundingClientRect().width;
    width = width > 768 ? 640 : width;
    rem = width / 7.5;
    docEl.style.fontSize = rem + 'px';
    }

    /**
    * 页面缩放或重载时刷新REM
    */
    win.addEventListener('resize', function() {
    clearTimeout(timer);
    timer = setTimeout(refreshRem, 300);
    }, false);
    win.addEventListener('pageshow', function(e) {
    if(e.persisted) {
    clearTimeout(timer);
    timer = setTimeout(refreshRem, 300);
    }
    }, false);

    refreshRem();

    /****reset****/
    body,div,table,tr,td,th,h1,h2,h3,h4,h5,h6,form,input,button,label,select,textarea,p,u,i,em,ul,ol,li,dl,dd,dt,img,article,aside,details,figcaption,figure,footer,header,menu,nav,section{ margin:0; padding:0;}
    img{ border:0 none; vertical-align:middle;100%;}
    li{ list-style:none;}
    h1,h2,h3,h4,h5,h6{ font-size:100%;font-weight:normal}
    em,i,dfn{ font-style:normal;}
    table{ border-collapse:collapse; border-spacing:0;100%;}
    a, input, select, textarea, area, button{ outline:none; font-family:inherit; font-size:inherit; border:none; background:none; color:inherit;}
    a{ text-decoration:none;}
    a:hover{text-decoration:none;}
    textarea{ overflow:auto; resize:none;}
    input[type="button"], input[type="submit"], input[type="reset"]{ cursor:pointer;-webkit-appearance: none;}

    html,body{ overflow-x:hidden;}
    html{ -webkit-tap-highlight-color: transparent;}
    body{font:400 14px/1 microsoft yahei, Tohoma, Arial; color:#333; text-align:left; background:#fff;}
    body{font-family: Arial, Helvetica, 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;}
    .fl{float:left;}
    .fr{float: right;}
    .clearfix{zoom:1;}

  • 相关阅读:
    USACO第三道题
    uva350 PseudoRandom Numbers
    uva10879 Code Refactoring
    Scrum 冲刺第一篇 晨曦
    WC.exe 晨曦
    [LeetCode 126] 单词梯II(Word Ladder II)
    [LeetCode 129] 根节点到叶子节点数字求和(Sum Root to Leaf Numbers)
    [LeetCode 125] 验证回文(Valid Palindrome)
    [LeetCode 123] 买入与卖出股票的最佳时机III(Best Time to Buy and Sell Stock III)
    [LeetCode 124] 二叉树最大路径和(Binary Tree Maximum Path Sum)
  • 原文地址:https://www.cnblogs.com/92xcd/p/8523521.html
Copyright © 2011-2022 走看看