摘要: 浏览器支持ie8+ <img src="img/blank.gif" alt="" data-echo="img/album-1.jpg"> <script> window.echo = (function (window, document) { 'use strict'; /* * Constr 阅读全文
posted @ 2015-05-12 15:06 surfaces 阅读(886) 评论(0) 推荐(0) 编辑
摘要: mousemove 拖拽操作 var count = 0; elem.onmousemove = function(){ count++; // 当计数器为偶数的时候不执行mousemove if( count % 2 0 ){ return; } // 实现拖拽功能的代码... }; 高频事件的简 阅读全文
posted @ 2015-05-12 14:19 surfaces 阅读(885) 评论(0) 推荐(0) 编辑
摘要: font-size:12px; line-height:22px; font-family:Arial,Helvetica,sans-serif; /*优化*/ font:12px/22px Arial,Helvetica,sans-serif; background-color:#eee; bac 阅读全文
posted @ 2015-05-12 13:06 surfaces 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 内联样式的获取 function getStyle(obj,attr){//简单的获取内联样式 return obj.currentStyle?obj.currentStyle[attr]:obj.getComputedStyle(obj,false)[attr]; }下面是比较完善的, ... 阅读全文
posted @ 2015-05-12 11:09 surfaces 阅读(822) 评论(0) 推荐(0) 编辑