Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gaohaoyang/upload-image-preview-plugin
Upload Preview Plugin on Web pages
https://github.com/gaohaoyang/upload-image-preview-plugin
Last synced: 2 days ago
JSON representation
Upload Preview Plugin on Web pages
- Host: GitHub
- URL: https://github.com/gaohaoyang/upload-image-preview-plugin
- Owner: Gaohaoyang
- License: mit
- Created: 2015-11-16T14:24:41.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-12T03:04:45.000Z (almost 9 years ago)
- Last Synced: 2024-10-30T06:34:56.223Z (15 days ago)
- Language: JavaScript
- Size: 51.8 KB
- Stars: 11
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Upload-Image-Preview-jQuery-Plugin
Choose upload image, local preview.## Demo
[click here to try it](http://gaohaoyang.github.io/Upload-Image-Preview-Plugin/example/) or see below ↓
![demo](http://ww1.sinaimg.cn/large/7011d6cfjw1eyvnqhp2v1g20k30eqb2a.gif)
## Usage
HTML```html
```
> You should edit the path according your situation.
put this anyWhere
```html
```> Or you can use other way to import jQuery and jQuery plugins, such as webpack, browserify
JavaScript
```js
$('.anyName').uploadPreview({
width: '200px',
height: '200px',
backgroundSize: 'cover',
fontSize: '16px',
borderRadius: '200px',
border: '3px solid #dedede',
lang: 'en', //language
});
```## Options
Name | Type | Default | Description
-------------- | ------ | ------- | ---------------------------------
width | String | '200px' | the width of preview area
height | String | '200px' | the height of preview area
backgroundSize | String | 'cover' | only 'cover', 'contain'
fontSize | String | '16px' | the size of words on preview area
borderRadius | String | '5px' | border-radius
border | String | 0 | the border of preview area
lang | String | 'zh-cn' | the language of plugin, now only 'en','zh-cn'## license
[MIT](https://github.com/Gaohaoyang/Upload-Preview-Plugin/blob/master/LICENSE)