摘要: 1 offsetWidth, offsetHeight 获取自身的宽度和高度 包括width+border+padding 2 3 console.log(box.style.width, box.style.height); 只能获取行内的 4 5 距离第一个有定位的父级盒子左边和上边的距离 box.offsetLeft, box.offsetTop,没有的话就是body box.of... 阅读全文
posted @ 2019-07-16 23:57 疏影横斜水清浅 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 1 (function (w) { 2 w.myTool = { 3 $: function (id) { 4 return typeof id === 'string' ? document.getElementById(id) : null; 5 }, 6 hasClassName: function... 阅读全文
posted @ 2019-07-16 23:09 疏影横斜水清浅 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 定时器、排他思想 阅读全文
posted @ 2019-07-16 22:48 疏影横斜水清浅 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 1 2 开始动画 3 4 阅读全文
posted @ 2019-07-16 22:47 疏影横斜水清浅 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 1 2 3 4 5 Title 6 49 50 51 52 53 54 55 56 57 112 113 window.onload = function (ev) { // 1. 获取标签 var... 阅读全文
posted @ 2019-07-16 22:16 疏影横斜水清浅 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 定时器先清除后设置,避免定时器的累加 阅读全文
posted @ 2019-07-16 22:08 疏影横斜水清浅 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 1 var cDate = new Date(); //获取当前时间 2 var nextDate = new Date('2022/11/08 08:41:35'); 3 console.log(nextDate); //定义时间 4 5 getTime() // 返回毫秒数和valueOf()结果一样 6 ... 阅读全文
posted @ 2019-07-16 21:38 疏影横斜水清浅 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 1 setInterval(function () { 2 console.log('1212'); 3 }, 2000) setInterval('console.log(\'哈哈哈哈\');', 1000) 1 function test() { 2 console.log('呵呵呵!'); 3 } 4 setInterval(tes... 阅读全文
posted @ 2019-07-16 21:19 疏影横斜水清浅 阅读(229) 评论(0) 推荐(0) 编辑