摘要: 今天费了一下午的劲,终于在vue-cli 生成的工程中引入了jquery,记录一下。(模板用的webpack) 首先在package.json里的dependencies加入"jquery" : "^2.2.3",然后install 在webpack.base.conf.js里加入 var webp 阅读全文
posted @ 2016-04-21 17:42 lily white 阅读(24205) 评论(4) 推荐(5) 编辑
摘要: 公司的应用调了一个微信上传下载图片的接口,本来在线上跑的好好的,什么问题没有,但是这两天总是不定时的出现下载下来的图片损坏,拿着Token和serverid去接口测试网页验证,返回的是Token失效了,返回信息:"errcode": 40001, "errmsg": "invalid credent... 阅读全文
posted @ 2015-11-21 12:41 lily white 阅读(1125) 评论(0) 推荐(0) 编辑
摘要: 接收的参数end是必须传的,格式是/分隔的日期字符串,start是可选的,不传就是从现在开始倒计时,callback也是可选的,到倒计时接收时执行自定义的函数。countdown({ 'end':'2015/9/1 17:12:00', '... 阅读全文
posted @ 2015-09-01 21:24 lily white 阅读(1640) 评论(0) 推荐(0) 编辑
摘要: 1.根据id或class或tag修改样式,样式名是-连接格式的。function setStyleById(elem, styles){ if(!(elem = $(elem)) return false; for(prop in styles){ ... 阅读全文
posted @ 2015-08-31 20:56 lily white 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 1.阻止冒泡。function stopPropagation(event){ event = event || getEvent(event); if(event.stopPropagation){ event.stopPropagation();... 阅读全文
posted @ 2015-08-30 23:21 lily white 阅读(236) 评论(0) 推荐(0) 编辑
摘要: function nextPage() { /* 克隆第一张图片并添加到box后 box前移一张图片的距离动画 动画回调里把box的left值设为0 删除第一张图片 */ $(".mypng li:first-child").clone().appendTo($(".mypng")); $(".m... 阅读全文
posted @ 2015-08-28 21:46 lily white 阅读(378) 评论(0) 推荐(0) 编辑
摘要: var timer; //绑定hover事件 $(function () { $(".centercy img").hover(showPic, hidePic); }); //显示图片 function showPic() { var el = $(this), imgUrl = "url(... 阅读全文
posted @ 2015-08-28 21:45 lily white 阅读(309) 评论(0) 推荐(0) 编辑
摘要: var pieChart = { width: 600, height: 400, series: [], unit: "kg", chartCanvas: null, selectable : true, title: "Pie Chart", le... 阅读全文
posted @ 2015-08-28 21:43 lily white 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 1.生成重复的字符串if(!String.repeat){ String.prototype.repeat = function (count){ return new Array(count + 1).join(this); }}2.去除开头和结尾的空字符if(!Stri... 阅读全文
posted @ 2015-08-28 21:42 lily white 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 还是本着学习的目的,实现一个自己的调试日志,界面很简单,就是将调试信息显示在页面的正中央,用一个ul包裹,每条信息就是一个li。 1.新建一个myLogger.js文件,将需要的方法声明一下。其中var声明的是私有成员,可见范围只在构造函数中,每个实例都会保存一套他们的副本。this声明的是特权方... 阅读全文
posted @ 2015-08-25 17:35 lily white 阅读(513) 评论(0) 推荐(0) 编辑