摘要: 关键技术1、FormData2、XMLHttpRequest先在页面布局如下结构 Select a File to Upload 以下是javascript脚本function fileSelected() { ... 阅读全文
posted @ 2014-01-23 09:29 风之约 阅读(873) 评论(0) 推荐(0) 编辑
摘要: 官网:http://www.gruntjs.org/发觉利用grunt打包压缩代码实在太方便了,以下是一个简单例子,更多实例详见官网/** * Created with JetBrains WebStorm. * User: EX-ZHOULINGFENG001 * Date: 14-1-9 * Time: 上午10:46 * To change this template use File | Settings | File Templates. *//** cmd* grunt concat* grunt uglify* grunt cssmin */module.exports = fu 阅读全文
posted @ 2014-01-23 09:22 风之约 阅读(247) 评论(0) 推荐(0) 编辑
摘要: /** HTML5的Web SQL Databases(html5 本地数据库)API* openDatabase方法打开一个已经存在的数据库,如果数据库不存在,它还可以创建数据库。几个参数意义分别是: 1,数据库名称。 2,版本号 目前为1.0,不管他,写死就OK。 3,对数据库的描述。 4,设置数据的大小。 5,回调函数(可省略)。** transaction:这个方法允许我们根据情况控制事务提交或回滚 executeSql函数有四个参数,其意义分别是: 1)表示查询的字符串,使用的SQL语言是SQLite 3.6.19。 ... 阅读全文
posted @ 2013-12-26 17:21 风之约 阅读(733) 评论(0) 推荐(0) 编辑
摘要: 先看效果:在index.html头部先加上 页面样式#box{position:relative;height:64px;border:1px dashed #000} #bar{position:relative;left:4%;top:16px;width: 90%;height: 10px;border:1px solid #666;border-radius: 5px;background: #fff} #drag-sec{position:absolute;top:-10px; left:2px; width: 16px;heig... 阅读全文
posted @ 2013-11-20 09:35 风之约 阅读(339) 评论(0) 推荐(0) 编辑
摘要: /** for example */function corpImg() {}corpImg.prototype = { constructor: corpImg, init : function (options) { if (typeof options != "object") return; this.box = document.getElementById(options.box); this.canvas = box.getElementsByTagName('canvas')[0]; this.c... 阅读全文
posted @ 2013-11-13 14:14 风之约 阅读(457) 评论(0) 推荐(0) 编辑
摘要: /* * Lottery.js* version 1.0* @example Lottery(id, start, end, goods, callBack);*/var Lottery = (function() { var canvas, render2D, start, end, goods, callBack, canvasW, canvasH, timer = null, goodNum = [], flag, ... 阅读全文
posted @ 2013-11-11 16:03 风之约 阅读(6424) 评论(1) 推荐(0) 编辑
摘要: /* example** var id = document.querySelector('.needFullDom'); id.onclick = function() { window.fullScreenApi.supportsFullScreen && fullScreenApi.requestFullScreen(id); }**/(function(){ var fullScreenApi = { supportsFullScreen: false, isFullScreen: function() { retu... 阅读全文
posted @ 2013-11-11 15:53 风之约 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1 var canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'); 2 var start = 1, end = 256, step = 30, direction = 'right'; 3 var len = end - start + 1, wLen = 1, hLen = 1, flag = 1; 4 var sideLength = Math.ceil(Math.sqrt(len)); // 总数求边长 5 var currentX = step 阅读全文
posted @ 2013-10-31 15:40 风之约 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 * Lottery.js 3 * version 1.0 4 * @example Lottery(id, start, end, goods, callBack); 5 */ 6 7 var Lottery = (function() { 8 var canvas, 9 render2D, 10 start, 11 end, 12 goods, 13 callBack, 14 canvasW, 15 canvasH,... 阅读全文
posted @ 2013-10-29 17:30 风之约 阅读(1163) 评论(0) 推荐(0) 编辑