1.1.3 • Published 8 years ago

upload-image-preview v1.1.3

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

Upload-Image-Preview-jQuery-Plugin

Choose upload image, local preview.

Demo

click here to try it or see below ↓

demo

Usage

HTML

<script src="jquery-2.1.4.min.js"></script>
<script src="jquery.upload_preview.min.js"></script>

You should edit the path according your situation.

put this anyWhere

<div class="anyName">
    <input type="file" accept="image/gif, image/jpeg, image/png">
</div>

Or you can use other way to import jQuery and jQuery plugins, such as webpack, browserify

JavaScript

$('.anyName').uploadPreview({
    width: '200px',
    height: '200px',
    backgroundSize: 'cover',
    fontSize: '16px',
    borderRadius: '200px',
    border: '3px solid #dedede',
    lang: 'en', //language
});

Options

NameTypeDefaultDescription
widthString'200px'the width of preview area
heightString'200px'the height of preview area
backgroundSizeString'cover'only 'cover', 'contain'
fontSizeString'16px'the size of words on preview area
borderRadiusString'5px'border-radius
borderString0the border of preview area
langString'zh-cn'the language of plugin, now only 'en','zh-cn'

license

MIT