2016年1月28日
摘要: (function (doc, win) { var docEl = doc.documentElement, resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', recalc = function 阅读全文
posted @ 2016-01-28 14:03 月落无声 阅读(341) 评论(0) 推荐(0) 编辑
  2015年12月11日
摘要: window.addEventListener("offline", function() { alert('offline')}, false);window.addEventListener("online", function() { alert('online')}, false... 阅读全文
posted @ 2015-12-11 10:22 月落无声 阅读(660) 评论(0) 推荐(0) 编辑
  2015年11月3日
摘要: var city = ["北京","天津","上海","重庆","杭州"];city.sort(function compareFunction(a,b){ return a.localeCompare(b); });console.log(city); ==>["北京",... 阅读全文
posted @ 2015-11-03 18:38 月落无声 阅读(1665) 评论(0) 推荐(0) 编辑
  2015年9月19日
摘要: 1、load() load()方法是jquery中最简单和常用的Ajax方法,能载入远程html代码并插入到DOM中,结构为load( url [, data] [, callback]); 参数名称 类型 说明 url String 请求HTML页面的url地址data(可选... 阅读全文
posted @ 2015-09-19 18:19 月落无声 阅读(476) 评论(0) 推荐(0) 编辑
摘要: 字体单位:rem@charset "utf-8";/* *create by chengkun 19/9/2015. *version 1.0. *Reset the browser default style.*//* 设置盒模型样式 */* { box-sizing: b... 阅读全文
posted @ 2015-09-19 17:44 月落无声 阅读(538) 评论(0) 推荐(0) 编辑
摘要: 使用前在页面中引入下面的代码/*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2006, 2014 Klaus Hartl * Released under the ... 阅读全文
posted @ 2015-09-19 16:12 月落无声 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 一、js cookie 使用时把此段代码引入页面(function (factory) { if (typeof define === 'function' && define.amd) { define(factory); } else if (typeof expor... 阅读全文
posted @ 2015-09-19 15:31 月落无声 阅读(1423) 评论(0) 推荐(0) 编辑
  2015年8月4日
摘要: var minute = 1000 * 60;var hour = minute *60;var day = hour *24;var week = day * 7;var month = day * 30;function getTimer(stringTime){ var time1 = ... 阅读全文
posted @ 2015-08-04 18:18 月落无声 阅读(4967) 评论(0) 推荐(0) 编辑
  2015年7月14日
摘要: 1、一般做法li的排序(call) 78 92 69 54 70 482、利用call方法,让arguments转换成数组li的排序(call) 78 92 69 54 70 48 阅读全文
posted @ 2015-07-14 10:45 月落无声 阅读(1494) 评论(0) 推荐(0) 编辑
  2015年7月10日
摘要: javascript返回上一页:1、返回上一页 history.go(-1); 返回上两个页面 history.go(-2);上一页2、history.back().3、window.history.forward() 返回下一页4、window.history.go(返回第几页,也可以是url)5... 阅读全文
posted @ 2015-07-10 17:18 月落无声 阅读(1302) 评论(0) 推荐(0) 编辑