欢迎来到博客园~~~
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页
摘要: function parabola(ele, stop){ //y == a*x^2 + bx + c //原点 var centerpoint = { x : ele.offsetLeft, y : ele.offsetTop } //目标点的 相对坐标系位置 var target = { x : 阅读全文
posted @ 2019-05-05 14:55 孙~洋 阅读(455) 评论(0) 推荐(0) 编辑
摘要: function animate(ele, props, callback) { //属性,属性值,动画时长 stopNow(); ele.timerlist = []; ele.cbk = callback; for (let attr in props) { let start = parseF 阅读全文
posted @ 2019-05-05 14:53 孙~洋 阅读(426) 评论(0) 推荐(0) 编辑
摘要: function show(ele) { ele.style.display = "block"; } function hide(ele) { ele.style.display = "none"; } function show(ele) { ele.style.display = "block 阅读全文
posted @ 2019-05-05 14:50 孙~洋 阅读(1687) 评论(0) 推荐(0) 编辑
摘要: // 添加cookie function addCookie(key,value,days) { var now = new Date(); now.setDate(now.getDate() + days); document.cookie = key+"="+value+"; expires=" 阅读全文
posted @ 2019-05-05 14:43 孙~洋 阅读(1138) 评论(0) 推荐(0) 编辑
摘要: object HTMLDivElement,即 HTMLDivElement 对象, 而这个对象是哪里来的呢? 查阅 《JavaScript权威指南》中文第六版363页, 我们可以知道: HTMLDivElement 是 HTMLElement 的一个子对象, 而 HTMLElement 又是 El 阅读全文
posted @ 2019-05-05 14:42 孙~洋 阅读(1077) 评论(0) 推荐(0) 编辑
摘要: function getPagePos(ele){ if(!ele) throw new Error("ele参数有问题,无法获取位置"); var _left = ele.offsetLeft; var _top = ele.offsetTop; while(ele.offsetParent) { 阅读全文
posted @ 2019-05-05 14:32 孙~洋 阅读(151) 评论(0) 推荐(0) 编辑
摘要: function getStyle(ele, prop) { if(ele.currentStyle) { //IE return ele.currentStyle[prop]; } else { //标准 return getComputedStyle(ele)[prop]; } } functi 阅读全文
posted @ 2019-05-05 14:28 孙~洋 阅读(111) 评论(0) 推荐(0) 编辑
摘要: function randomColor(){ var r = randomInt(0,255).toString(16); var g = randomInt(0,255).toString(16); var b = randomInt(0,255).toString(16); return "# 阅读全文
posted @ 2019-05-05 14:27 孙~洋 阅读(263) 评论(0) 推荐(0) 编辑
摘要: function randomInt(a, b) { if(parseInt(a) != a || parseInt(b) != b) { throw new Error("请输入整数参数!!") } return Math.min(a,b)+ Math.floor(Math.random()*Ma 阅读全文
posted @ 2019-05-05 14:26 孙~洋 阅读(172) 评论(0) 推荐(0) 编辑
摘要: function getDateAfterNdays(n){ var now = new Date(); now.setDate( now.getDate()+n ); return now; } function getDateAfterNdays(n){ var now = new Date() 阅读全文
posted @ 2019-05-05 14:25 孙~洋 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 15 下一页