Skip to content

Image loader is plugin that loads image selected by input file field without uploading it on server.

Notifications You must be signed in to change notification settings

goschevski/image-loader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image loader

Image loader is plugin that loads image selected by input file field without uploading it on server.

Options and defaults

placeholder: '.image-placeholder' - Selector in which image will be loaded

width: auto - Width of loaded image

height: auto - Height of loaded image

imgClass: 'img-load' - Class that will be added to loaded image

method: 'html' - Method that will be used to add image (html (default), append or css which will add image as background of placeholder)

callback: null - If you want to make something happen after loading image, callback is function for that

Examples

$(function () {
  var loader = new ImageLoader('input[type="file"]', {
    placeholder: '.holder',
    width: '200px',
    imgClass: 'my-custom-class',
    callback: function () {
      console.log('image added to .holder');
    }
  });
});

License

Copyright (c) Aleksandar Goševski

About

Image loader is plugin that loads image selected by input file field without uploading it on server.

Resources

Stars

Watchers

Forks

Packages

No packages published