前端开发笔记

发布时间: 2017-01-01

viewport:

<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport">

关闭手机号码自动识别:

<meta name="format-detection" content="telephone=no" />

电话和短信:

<a href="tel:10086">10086</a>

<a href="sms:10086">10086</a> 

rem设置:

// 让1rem等于PSD的100px
new function () {
    var _self = this;
    _self.width = 640; // 设置PSD的宽度
    _self.bili = function () {
        return (document.body.clientWidth || document.documentElement.offsetWidth) / _self.width;
    };
    _self.changePage = function () {
        document.documentElement.setAttribute('style','font-size:' +  _self.bili() * 100 + "px !important");
    }
    _self.changePage();
    window.addEventListener('resize', _self.changePage, false);
};