https://github.com/litten/mobileimgviewer
A smooth picture viewer library for mobile web development. 一个流畅的图片查看库,用于移动web开发。
https://github.com/litten/mobileimgviewer
Last synced: over 1 year ago
JSON representation
A smooth picture viewer library for mobile web development. 一个流畅的图片查看库,用于移动web开发。
- Host: GitHub
- URL: https://github.com/litten/mobileimgviewer
- Owner: litten
- License: mit
- Created: 2014-09-04T09:17:04.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-09-19T10:16:42.000Z (almost 12 years ago)
- Last Synced: 2025-04-08T11:51:36.861Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 813 KB
- Stars: 5
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
MobileImgViewer
===============
A smooth picture viewer library for mobile web development, which has the same experience with native APPs.
一个流畅的图片查看库,用于移动web开发。其拥有与本地应用相同的体验。
###Demo 栗子
[Demo](http://littendomo.sinaapp.com/mobileImgviewer/example.html)

###Usage 使用
####1、Basic 基础
```js
/* @param ctn {Dom} a Dom that contains imgs
*/
new MobileImgViewer({
ctn: document.getElementById('ctn')
});
```
####2、Advanced 进阶
```js
/* @param ctn {Dom} a Dom that contains imgs
* @param backBtn {String} wordings on the back button
* @param menu {Array} menus on the upper right corner
* @param menu>btn {String} the text on the menu buttons
* @param menu>callback {Function} callback of the menu buttons
*/
new MobileImgViewer({
ctn: document.getElementById('ctn'),
backBtn: "查看图片",
menu: [{
btn: "btn1",
callback: function(event){
alert("you touch btn1");
}
},{
btn: "btn2",
callback: function(event){
alert("you touch btn2");
}
},{
btn: "btn3",
callback: function(event){
lert("you touch btn3");
}
}]
});
```