摘要: rem两个比较好的框架 淘宝Flexible https://github.com/amfe/lib-flexible 使用Flexible实现手淘H5页面的终端适配 https://github.com/amfe/article/issues/17 adaptive https://github. 阅读全文
posted @ 2015-05-14 17:09 surfaces 阅读(1186) 评论(0) 推荐(0) 编辑
摘要: tap事件 tap 事件相当于 pc 浏览器中的 click 效果,虽然在触屏设备上 click 事件仍然可用,但是在很多设备上,click 会存在一些延迟,如果想要快速响应的 “click” 事件,需要借助 touch 事件来实现。 element.addeventlistener( 'touch 阅读全文
posted @ 2015-05-14 14:21 surfaces 阅读(637) 评论(0) 推荐(0) 编辑
摘要: //第一个 Author: Alone //依赖jQuery 或者Zepto 第二个 作者未知(依赖jquery) 第三个 其他地方 阅读全文
posted @ 2015-05-14 14:10 surfaces 阅读(2515) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2015-05-14 13:53 surfaces 阅读(261) 评论(0) 推荐(0) 编辑
摘要: <script> var isIe = !-[1,]; // alert('ie9 之前'+isIe); var ie = 'ActiveXObject' in window; //alert('sadsd'+ie); var ie2 = !!('ActiveXObject' in window); 阅读全文
posted @ 2015-05-14 13:45 surfaces 阅读(879) 评论(0) 推荐(0) 编辑
摘要: 使用iScroll时,input等不能输入内容的解决方法 <script> function allowFormsInIscroll(){ [].slice.call(document.querySelectorAll('input, select, button')).forEach(functi 阅读全文
posted @ 2015-05-14 11:26 surfaces 阅读(2989) 评论(0) 推荐(1) 编辑
摘要: 参考写的类似的 pie 饼状图 效果如下 代码如下 阅读全文
posted @ 2015-05-14 09:25 surfaces 阅读(17761) 评论(1) 推荐(0) 编辑
摘要: 简单的常见的操作;假设每个便签添加一个 属性 -webkit-animation-delay:0.1s 递增操作;;通过for循环添加 <ul id="uls"> <li style="background:red">0</li> <li>1</li> <li style="background:# 阅读全文
posted @ 2015-05-13 13:20 surfaces 阅读(2111) 评论(0) 推荐(0) 编辑
摘要: 浏览器支持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) 编辑
摘要: //预览地址: http://mall.3d414.com/suc/index.html 说明:电脑端通过操纵tabindex 键操作右侧信息栏目 <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA- 阅读全文
posted @ 2015-05-11 17:35 surfaces 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 雪佛兰手机版官网的菜单略微有点缺点;布局上的缺点;自己稍微完善一下; 样式有点丑; 动画帧也是可以实现;比较简单点;不过我没弄; 下面效果图: css布局及原理: <!doctype html> <html> <head> <meta charset="utf-8"> <title>雪佛兰</tit 阅读全文
posted @ 2015-03-30 14:31 surfaces 阅读(416) 评论(0) 推荐(0) 编辑
摘要: 效果: 关键点:利用keyframes 原理:infinite 注意点:在处理关键帧动画的时候,注意处理好 总共花费的 animation-duration:time 与每帧延延迟的时间的交错;要让动画显得层次感,处理好 每帧的延迟时间; 多注意时间的穿插 ;效果更很好;下面只是我的小插图;画的不一 阅读全文
posted @ 2015-03-26 13:59 surfaces 阅读(2564) 评论(0) 推荐(0) 编辑