Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 23, 2016
1 parent f31c586 commit 81f389e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- 支持 URL 加载语言
- 支持本地缓存选择

![translater.js 动画效果](translater.js.gif)

# 作为模块安装

```bash
Expand All @@ -32,10 +34,10 @@ var tran = new Translater({

切换语言方法通过超链接

```html
```html
<a href="javascript:tran.setLang('default');">English</a>
<a href="javascript:tran.setLang('jp');">日本語</a>
<a href="javascript:tran.setLang('cn');">中文</a>
<a href="javascript:tran.setLang('cn');">中文</a>
```

可以通过URL穿参数设置语言
Expand All @@ -56,7 +58,7 @@ http://127.0.0.1:9005/test/test.html?lang=jp

## 图片切换

```html
```html
<img alt="images" src="../img/image.jpg" data-lang-cn="../img/image_cn.jpg" data-lang-jp="../img/image_jp.jpg" />
```

Expand Down
Binary file added translater.js.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 81f389e

Please sign in to comment.