随笔分类 -  often use

摘要:div1.onmousedown = function(e){ //var x = e.offsetX; // 有些浏览器不支持offsetX和Y //var y = e.offsetY; var x = e.clientX - div1.offsetLeft;//推荐使用这种写法获取offsetX和Y var y = e.clientY - div1.of... 阅读全文
posted @ 2018-04-21 17:37 悔创阿里-杰克马 阅读(124) 评论(0) 推荐(0)
摘要:var e = new Error("this is a Error"); console.log(typeof(e),e); thorw( e );//抛出错误 //容错 try{ //尝试执行try里面的代码 var a; console.log(a); }catch(e){ //参数e,表示错误 //如果try中代码出错,则执行catch里的代码 alert(e.message);... 阅读全文
posted @ 2018-04-21 11:45 悔创阿里-杰克马 阅读(85) 评论(0) 推荐(0)
摘要:function createFn(name){ this.name = name ; } createFn.prototype.study = function(){ return this.name+"在学习";; } var createFn2 = new createFn("tom"); alert(creat... 阅读全文
posted @ 2018-04-19 20:35 悔创阿里-杰克马 阅读(117) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2018-04-17 22:48 悔创阿里-杰克马 阅读(155) 评论(0) 推荐(0)
摘要:... 阅读全文
posted @ 2018-04-17 22:45 悔创阿里-杰克马 阅读(157) 评论(0) 推荐(0)
摘要:... 阅读全文
posted @ 2018-04-17 19:41 悔创阿里-杰克马 阅读(206) 评论(0) 推荐(0)
摘要:运动原理:通过定时器持续改变某元素的属性。匀速运动:每一次更改属性时,步长值是相同的。1,注意css属性为数值的,才能够进行运动。比如width、height、font-size、left、top等。2,如果属性是left、top这种,需要有position才能进行运动。3,很多时候,第一次获取属性 阅读全文
posted @ 2018-04-16 23:17 悔创阿里-杰克马 阅读(113) 评论(0) 推荐(0)
摘要:/* * elem: 操作哪一个元素 * json:表示多个属性 * attr: 操作的那个元素的css中的什么属性 * value: 操作的那个元素的css中的那个属性的目标值 * cb:回调函数,前一个运动执行后,这一段代码才被执行 */ var startMove = (elem, json, cb)=>{ // 每当执行运动函数的时候... 阅读全文
posted @ 2018-04-16 22:35 悔创阿里-杰克马 阅读(215) 评论(0) 推荐(0)
摘要:查询body的方法 查询html的方法 查询所有元素 查询元素 根据class名 按css样式来查询 查询name属性 阅读全文
posted @ 2018-04-16 09:09 悔创阿里-杰克马 阅读(263) 评论(0) 推荐(0)
摘要:正则表达式手册 表达式全集 常用正则表达式 阅读全文
posted @ 2018-04-13 21:06 悔创阿里-杰克马 阅读(123) 评论(0) 推荐(0)

求投食~(点图即可)