diff --git a/README.md b/README.md index 1de4ce0..dfe402d 100644 --- a/README.md +++ b/README.md @@ -1,31 +1,66 @@ # Calendar-js -[](https://github.com/772807886/Calendar-js) +[](https://github.com/772807886/Calendar-js) [](https://raw.githubusercontent.com/772807886/Calendar-js/master/LICENSE) [](https://github.com/772807886/Calendar-js/stargazers) [](https://github.com/772807886/Calendar-js/network) [](https://github.com/772807886/Calendar-js/issues) -一个使用JS编写的日历库,遵循ES2015+CSS3标准 +An Calendar library written in JS, based on ES2015 and CSS3. -### [Demo](http://772807886.github.io/Calendar-js/demo.html) +一个使用 JS 编写的日历库,遵循 ES2015 + CSS3 标准 -### 写在前面 -这个类库的开始就是以ES6+CSS3为基础的,不对旧版本浏览器进行兼容,在新版本的Chrome和Firefox均可以直接使用。 +### [Demo 呆萌](http://772807886.github.io/Calendar-js/demo.html) -如果需要对旧版浏览器进行兼容,可以自行使用[Babel](https://babeljs.io/repl/)转换为ES5后使用。 +### Before Use 写在前面 +This Library is based on ES6 and CSS3, so it just work well in newer browsers. + +这个类库的开始就是以 ES6 + CSS3 为基础的,不对旧版本浏览器进行兼容,在新版本的浏览器中可以直接使用。 + +If you need older browsers support, try [Babel](https://babeljs.io/repl/) please! + +如果需要对旧版浏览器进行兼容,可以自行使用 [Babel](https://babeljs.io/repl/) 转换为 ES5 后使用。 + +> This Library is based on Shadow Dom, so it's can only work on Chrome 35+, Opera 22+, Safari 10, and if you want to use it on Firefox 29+, you must go to [about:config](about:config) and turn on the switch named *dom.webcomponents.enabled*. + +> 使用到 Shadow Dom 技术,目前 Chrome 35+、Opera 22+、Safari 10 可以直接使用,FireFox 29+ 需要在 [about:config](about:config) 中开启 *dom.webcomponents.enabled* 开关才可以使用。 + +***This is the first time I try to write documents in English, please tell me if I have any syntax error, Thanks!*** + +***第一次完全使用英文注释,如有英语语法错误,请告知,谢谢!*** + +### Known Problems 已知问题 +- Firefox(Nightly 51.0a1 2016-08-09)发现在 Shadow Dom 中控制 Element 的 display: none 样式时,会导致页面**崩溃**。 + +### Citation 引用说明 +农历计算部分相关算法参考自 [zzyss86/LunarCalendar](https://github.com/zzyss86/LunarCalendar)。 ## Usage 使用方法 -1. 从GitHub Release[](https://github.com/772807886/Calendar-js/releases)下载最新版本类库,包含压缩版的calendar.min.css、calendar.min.js与未压缩版的calendar.css、calendar.js。 -2. 在页面中包含calendar.min.css(开发环境下包含未压缩版:calendar.css)和calendar.min.js(开发环境下包含未压缩版:calendar.js)。 +- Download the newest archives in GitHub Release[](https://github.com/772807886/Calendar-js/releases), includes calendar.js and it's compressed version: calendar.min.js. + +> 从 GitHub Release[](https://github.com/772807886/Calendar-js/releases) 下载最新版本类库,包含压缩版的 calendar.min.js 与未压缩版的 calendar.js。 + +- Import calendar.min.js in your web page. (If you want to debug it, you can also import calendar.js.) + +> 在页面中包含 calendar.min.js(开发环境下包含未压缩版:calendar.js)。 + ```html - ``` -3. 定义一个div容器,并指定id、宽度和高度。 + +- Now, create a div element with id, and you can also set up it's width, height and other properties. + +> 定义一个 div 容器,并指定 id,可选指定宽度和高度及其它属性。 + ```html
``` -4. 使用div容器的id构造Calendar对象。 + +**注意:宽度与高度设置过小可能影响显示效果!** + +- Create an object with div element's id. + +> 使用 div 容器的 id 构造 Calendar 对象。 + ```javascript -let obj = Calendar("calendar"); +let obj = new Calendar("calendar"); ``` diff --git a/css/calendar.css b/css/calendar.css deleted file mode 100644 index ffcbe8d..0000000 --- a/css/calendar.css +++ /dev/null @@ -1,4 +0,0 @@ -/** - * Calendar.css - https://github.com/772807886/Calendar-js - * Created by Liming on 2016/8/1. - */ diff --git a/demo.html b/demo.html index 1d42ba4..7e0f7de 100644 --- a/demo.html +++ b/demo.html @@ -12,13 +12,26 @@ content="width=device-width,height=device-height,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>