随笔分类 -  js

摘要:这个滑动条 淘宝 app上比较常见;滑动条 全部 男1装 女2装 鞋3子 ... 阅读全文
posted @ 2015-05-28 14:12 surfaces 阅读(945) 评论(0) 推荐(0)
摘要: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 阅读(1207) 评论(0) 推荐(0)
摘要:tap事件 tap 事件相当于 pc 浏览器中的 click 效果,虽然在触屏设备上 click 事件仍然可用,但是在很多设备上,click 会存在一些延迟,如果想要快速响应的 “click” 事件,需要借助 touch 事件来实现。 element.addeventlistener( 'touch 阅读全文
posted @ 2015-05-14 14:21 surfaces 阅读(655) 评论(0) 推荐(0)
摘要:第一个 /*! * tap.js * Copyright (c) 2015 Alex Gibson * https://github.com/alexgibson/tap.js/ * Released under MIT license */ /* global define, module */ 阅读全文
posted @ 2015-05-14 14:10 surfaces 阅读(2581) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2015-05-14 13:53 surfaces 阅读(265) 评论(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 阅读(912) 评论(0) 推荐(0)
摘要:参考写的类似的 pie 饼状图 效果如下 代码如下 阅读全文
posted @ 2015-05-14 09:25 surfaces 阅读(17878) 评论(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 阅读(2131) 评论(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 阅读(899) 评论(0) 推荐(0)
摘要:mousemove 拖拽操作 var count = 0; elem.onmousemove = function(){ count++; // 当计数器为偶数的时候不执行mousemove if( count % 2 0 ){ return; } // 实现拖拽功能的代码... }; 高频事件的简 阅读全文
posted @ 2015-05-12 14:19 surfaces 阅读(908) 评论(0) 推荐(0)
摘要:内联样式的获取 function getStyle(obj,attr){//简单的获取内联样式 return obj.currentStyle?obj.currentStyle[attr]:obj.getComputedStyle(obj,false)[attr]; }下面是比较完善的, ... 阅读全文
posted @ 2015-05-12 11:09 surfaces 阅读(832) 评论(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 阅读(347) 评论(0) 推荐(0)
摘要:雪佛兰手机版官网的菜单略微有点缺点;布局上的缺点;自己稍微完善一下; 样式有点丑; 动画帧也是可以实现;比较简单点;不过我没弄; 下面效果图: css布局及原理: <!doctype html> <html> <head> <meta charset="utf-8"> <title>雪佛兰</tit 阅读全文
posted @ 2015-03-30 14:31 surfaces 阅读(430) 评论(0) 推荐(0)
摘要:上图的 demo 主要讲的 是 css transition的过渡回调函数transitionend事件; css3 的时代,css3--动画 一切皆有可能; 传统的js 可以通过回调函数判断动画是否结束;即使是采用CSS技术生成动画效果,JavaScript仍然能捕获动画或变换的结束事件; tra 阅读全文
posted @ 2015-03-09 17:18 surfaces 阅读(36428) 评论(3) 推荐(4)
摘要:去年面试过一家做网站的 公司,看了一下他们的案例,看懂一个蛮有意思的 ,一个房地产的官网,是用flash做的。感觉不错。 于是,闲暇之际,简单的jquery 模仿做了一下。下面是我的效果图.脚本也没啥优化,流畅度也没有flash流畅。但是重要的是看到这个flash,想到 如何实现它效果的思路,非常适 阅读全文
posted @ 2015-03-03 14:28 surfaces 阅读(1126) 评论(0) 推荐(0)