Code Monkey

于工开始移山

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2015年3月19日

摘要: 需求:SVG根据父容器(DIV)大小进行缩放,只改变SVG宽的缩放比,SVG高的缩放比不变。解决:svg 元素属性preserveAspectRatio = “none”参考:svg attribute reference 中文参考文章Demo:3837363534333231302928272... 阅读全文
posted @ 2015-03-19 15:02 MSchina 阅读(217) 评论(0) 推荐(0) 编辑

2015年2月26日

摘要: 描述:我要实现一个 fluid layout, 左右结构(左定宽、右100%填充;右边子容器是上下结构,上结构定高,下结构100%填充)。思路:用 table-cell 实现左右(没有用 float),右边的上下结构采用 box-sizing: border-box;(即 padding-top +... 阅读全文
posted @ 2015-02-26 15:51 MSchina 阅读(1711) 评论(0) 推荐(0) 编辑

2015年2月2日

摘要: /* queue FIFO */ (function () { var queue = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k'], iHead = 0... 阅读全文
posted @ 2015-02-02 15:45 MSchina 阅读(135) 评论(0) 推荐(0) 编辑

2015年1月30日

摘要: (function () { /* 通排序 最快最简单的排序 */ var data = [100, 50, 75, 25, 1, 20, 90, 30, 80, 40, 60, 50], result =... 阅读全文
posted @ 2015-01-30 17:05 MSchina 阅读(147) 评论(0) 推荐(0) 编辑

2015年1月23日

摘要: 绝对不能对异步回调函数(即使在数据已经就绪)进行同步调用。如果对异步回调函数进行同步调用的话,处理顺序可能会与预期不符,可能带来意料之外的后果。对异步回调函数进行同步调用,还可能导致栈溢出或异常处理错乱等问题。如果想在将来某时刻调用异步回调函数的话,可以使用setTimeout等异步API。func... 阅读全文
posted @ 2015-01-23 16:07 MSchina 阅读(355) 评论(0) 推荐(0) 编辑

2014年12月12日

摘要: 页面名称 已经有超过90%的用户使用更高版本 Google Chrome 或 In... 阅读全文
posted @ 2014-12-12 14:36 MSchina 阅读(183) 评论(0) 推荐(0) 编辑

2014年11月28日

摘要: JPEG文件有两种保存方式他们分别是Baseline JPEG(标准型)和Progressive JPEG(渐进式)。两种格式有相同尺寸以及图像数据,他们的扩展名也是相同的,唯一的区别是二者显示的方式不同。 另外渐进式的图片的大小并不会和基本的图片大小相差很多,有时候可能会比基本图片更小。渐进... 阅读全文
posted @ 2014-11-28 16:09 MSchina 阅读(315) 评论(0) 推荐(0) 编辑

摘要: Vertical Align Center 阅读全文
posted @ 2014-11-28 09:53 MSchina 阅读(150) 评论(0) 推荐(0) 编辑

摘要: /*! * jQuery UI Touch Punch 0.2.3 * * Copyright 2011–2014, Dave Furfero * Dual licensed under the MIT or GPL Version 2 licenses. * * Depends: * jquer... 阅读全文
posted @ 2014-11-28 09:48 MSchina 阅读(758) 评论(0) 推荐(0) 编辑

2014年10月14日

摘要: [].forEach(function(value,index,array){},this);[].some(function(value,index,array){return true;/* stop */},this);[].every(function(value,index,array){... 阅读全文
posted @ 2014-10-14 12:25 MSchina 阅读(123) 评论(0) 推荐(0) 编辑