web前端开发笔记(二)

1.美化checkbox和radio
icheck
虽然看github上这个项目已经一年没更新了,但是样式还是不错的,就拿来用了。

2.switch在作对比时用的是全等运算。

3.javascript中实现继承的方法
1)通过prototype实现
2)通过Object.create()实现
3)es6方法,通过class实现

3.动态加载script标签,加载完成事件

var script= document.createElement("script");
document.head.appendChild(script);
script.onload = scriptLoaded;
script.onreadystatechange = scriptLoaded;
script.src = "script.js";

function scriptLoaded() {
    if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete") {
        script.onload = script.onreadystatechange = null;
        console.log("loaded");
    }
}

原链接

4.drop-shadow和box-shadow的区别
drop-shadow的优点:是真正的阴影,box-shadow只是矩形盒子阴影
box-shadow的优点:
1)兼容性好;
2)支持内阴影;
3)支持多重阴影;

5.loading动画图标
preloaders.net
loading.io

6.去除input number的上下箭头

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button{
  -webkit-appearance: none !important;
  margin: 0;
}
input[type="number"]{-moz-appearance:textfield;}

7.在微信开发中,video标签要放在全局滚动中。
8.移动端rem解决方案。链接
9.Safari浏览器Date对象解析bug
要把日期中的-替换成/,Safari才能正确解析
链接

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值