摘要: 1. 事件绑定 代码 //通用事件绑定函数 function commonAddEvent(obj, event, func) { if (obj.attachEvent) { //IE obj.attachEvent("on" + event, func); } else { ... 阅读全文
posted @ 2015-12-18 17:33 将军喊俺哥 阅读(229) 评论(0) 推荐(0) 编辑
摘要: MARK 阅读全文
posted @ 2015-12-17 16:33 将军喊俺哥 阅读(114) 评论(0) 推荐(0) 编辑
摘要: "css中margin left与left的区别" 阅读全文
posted @ 2015-12-17 11:18 将军喊俺哥 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 1 window.onload = function() { 2 var oTb = document.getElementById("tb1"); 3 4 //隔行变色 5 for (var i = 0; i < oTb.tBodies[... 阅读全文
posted @ 2015-12-17 10:48 将军喊俺哥 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1 window.onload = function() { 2 new Drag("div1"); 3 new LimitDrag("div2"); 4 }; 5 6 //父类 7 function Drag(id) { 8 ... 阅读全文
posted @ 2015-12-15 23:23 将军喊俺哥 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1. 物体掉落 1 window.onload = startMove; 2 3 var iSpeedX = 100; 4 var iSpeedY = 8; 5 6 function startMove() { 7 setInterval(... 阅读全文
posted @ 2015-12-15 22:43 将军喊俺哥 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 1. 弹性运动公式 1 window.onload = function() { 2 var oDiv = document.getElementById("div1"); 3 var iSpeed = 0; 4 5 setInterval(... 阅读全文
posted @ 2015-12-15 11:20 将军喊俺哥 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 1. 匀速运动 1 /** 2 * @param obj - 待改变的对象 3 * @param json - 待改变的属性列表 4 * @return func - 链式调用 5 */ 6 function startMove(obj, j... 阅读全文
posted @ 2015-12-14 13:18 将军喊俺哥 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1 function setCookie(name, value, day) { 2 var oDate = new Date(); 3 oDate.setDate(oDate.getDate() + day); 4 document.coo... 阅读全文
posted @ 2015-12-14 00:23 将军喊俺哥 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1 window.onload = function() { 2 var oDiv = document.getElementById("div1"); 3 var disX = 0; 4 var disY = 0; 5 6 ... 阅读全文
posted @ 2015-12-14 00:21 将军喊俺哥 阅读(142) 评论(0) 推荐(0) 编辑