Skip to content

Simple and lightweight image previewer before upload

Notifications You must be signed in to change notification settings

rana7cse/imo-viewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#jquery.imoViewer

A lightweight jQuery plugin for image previewer when you change a image through file input before uploading. That's also help you to validate image property (e.g size,width,height).

Usage

Initialization & Settings

Basic usage with setup on single html file

<script src="dist/jquery.min.js"></script>
<script src="dist/imoViewer-min.js"></script>
<script>
  $(function() {
    $('fileelement').imoViewer({
      'preview' : 'preview-image-element'
    });
  })
</script>

###example Html markup

<image id="image-previe" src="placeholder"/>
<input id="image-input" type="file" />

JavaScript

$(function() {
    $('#image-input').imoViewer({
      'preview' : '#image-previe', // preview image element id
      'minWidth' : 200, // accepted min width
      'minHeight' : 200, // accepted min height
      'onError' : function(message,file) { // error callback
        // your code gose here
      },
      'onSuccess' : function(element,file) { // after pass validation successfully show image callback
        // your code gose here
      }
    });
})

About

Simple and lightweight image previewer before upload

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published