Skip to content
Image loader is plugin that loads image selected by input file field without uploading it on server.
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
.gitignore
image-loader.js
package.json
readme.md

readme.md

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

You can’t perform that action at this time.