摘要: /** * 格式化时间,1秒前,1分钟前 今天 10:11 昨天 10:11 9月11日 10:10 * @param {Date} date 时间对象 * @param {Date} currentDate 对比时间 * @return {String} 格式化后的时间内容 */var shortTime = function(date, currentDate) { var now = currentDate, // 今日秒数 todaySec = now.getHours() * 3600 + now.getMinutes() * 60 + now.ge... 阅读全文
posted @ 2013-03-30 16:29 xngeer 阅读(217) 评论(0) 推荐(0)
摘要: 哪里都在用suggest。自己写一个,改起来灵活随意function Suggest(obj, url, callback){ obj = typeof obj == "string" ? $("#" + obj) : $(obj); this.position = obj.offset(); this.left = this.position.left; this.top = this.position.top; if(obj[0].offsetHeight){ this.top = this.top + obj[0].offsetHeight; } 阅读全文
posted @ 2013-03-30 16:12 xngeer 阅读(248) 评论(0) 推荐(0)
摘要: checkbox , radio 的点选不会修改它们的checked属性以下用法无效:$("input[name=q][checked]");$("input[name=q][checked=checked]");以下用法有效:$("input[name=q]:checked");是否已选?$(this).is(":checked")改变状态this.checked = bool; 阅读全文
posted @ 2013-03-30 16:05 xngeer 阅读(298) 评论(0) 推荐(0)