zoukankan      html  css  js  c++  java
  • rem布局,flexible.js

    //author:caibaojian
    //website:http://caibaojian.com
    //weibo:http:weibo.com/kujian
    //这段js的最后面有两个参数记得要设置,一个为设计稿实际宽度,一个为制作稿最大宽度,例如设计稿为750,最大宽度为750,则为(750,750)         (此代码根节点为100px,设计稿最大宽度和屏幕宽度为750)
    !function(e,t){function n(){var n=l.getBoundingClientRect().width;t=t||540,n>t&&(n=t);var i=100*n/e;r.innerHTML="html{font-size:"+i+"px;}"}var i,d=document,o=window,l=d.documentElement,r=document.createElement("style");if(l.firstElementChild)l.firstElementChild.appendChild(r);else{var a=d.createElement("div");a.appendChild(r),d.write(a.innerHTML),a=null}n(),o.addEventListener("resize",function(){clearTimeout(i),i=setTimeout(n,300)},!1),o.addEventListener("pageshow",function(e){e.persisted&&(clearTimeout(i),i=setTimeout(n,300))},!1),"complete"===d.readyState?d.body.style.fontSize="16px":d.addEventListener("DOMContentLoaded",function(e){d.body.style.fontSize="16px"},!1)}(750,750);
  • 相关阅读:
    第一阶段总结
    第二次项目总结(移动端)
    iOS 配置smart svn8.6.6
    iOS Xcode6.4添加pch文件
    iOS 上传应用到APPStore 详细版
    真机测试
    ios 引导页
    iOS 画图工具的截图
    iOS UIViewController
    iOS 把图片存到相册中
  • 原文地址:https://www.cnblogs.com/fqh123/p/9836246.html
Copyright © 2011-2022 走看看