JS Image Loader 1.3

Description
It鈥檚 a JavaScript code that can be easy integrated into any web application and work in actual web browsers. After the integration you can add images into the form and they will be uploaded on server. Images can be moved or rotated and they all will be resized automatically on the client side. Besides selected images the form can contain any additional input fields.
How to Integrate
1. Include stylesheet and scripts into the head of the page:<link href="imageloader.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="jquery-1.7.min.js"></script> <script type="text/javascript" src="imageloader.min.js"></script>2. Add a form into the body of the document:
<form class="imageloaderForm" method="post" action="save.php"> <input type="button" class="imageloaderBrowse" value="Browse Images"> <input type="button" class="imageloaderClear" value="Clear All"> <div class="imageloaderFiles" /> <input type="submit" value="Send Form"> </form>3. Add a script to init ImageLoader:
document.addEventListener("DOMContentLoaded", function () {
ImageLoader.init({
limit: 5, // files limit
resize: true, // resize images or not (true/false)
moveSpeed: 100, // animation speed during sorting
maxWidth: 500, // max width if 'resize' enabled
maxHeight: 500, // max height if 'resize' enabled
isJpeg: false, // images format is JPEG or PNG with alpha channel (true/false)
jpegQuality: 0.8, // jpeg quality of images if 'isJpeg' enabled (from 0 to 1)
jpegBg: '#FFFFFF', // background fill color if 'isJpeg' enabled
form: 'imageloaderForm', // form class name
files: 'imageloaderFiles', // files container class name
file: 'imageloaderFile', // file class name
image: 'imageloaderImage', // image class name
ghost: 'imageloaderGhost', // file ghost class name when sorting
btnBrowse: 'imageloaderBrowse', // browse button class name
btnClear: 'imageloaderClear', // clear button class name (optional)
btnRotate: 'imageloaderRotate', // rotate button class name
btnRemove: 'imageloaderRemove', // remove button class name
rotateTitle: 'Rotate', // rotate button title
removeTitle: 'Remove', // remove button title
filter: ['.jpeg', '.jpg', '.png', '.gif', '.bmp', '.ico'], // files type filter
onSubmit: function(form){ // form submit handler (optional)
// ... validate the form if it's needed
return true; // return false to prevent uploading the form
},
onFinish: function(form, data){ // form uploaded handler (optional)
alert('ImageLoader: Form has been uploaded');
// ... redirect to another page or make something with returned data
},
onError: function(error){ // form error handler (optional)
alert('ImageLoader: ' + error);
}
});
})
4. Form will be uploaded asynchronously using an AJAX request. Variable names will have the prefix imageloader so you can easy identify them from others. Here is an example of code how to save images on PHP:
foreach($_FILES as $item => $value){
if(substr($item, 0, 11) == 'imageloader'){
$filename = str_replace('_', '.', $item); // filename
move_uploaded_file($value['tmp_name'], $filename);
}
}| Type | JavaScript Script |
|---|---|
| Author | OlDenWeb |
| Category | Javascript / Loaders And Uploaders |
| Price | $16 |
| Sales | 99 |
| Rating | 2.71 from 7 ratings |
| Published | Jun 26, 2016 |
| Last Update | Mar 31, 2018 |
| Compatible Browsers | IE10, IE11, Firefox, Opera, Chrome, Edge |
| Compatible Software | jQuery |
| Source Files Included | JavaScript JS, HTML, CSS, PHP |
Categories
Tags
External listing. code.market does not sell this product and does not process payment for it. Pricing, payment, delivery, licensing, refunds, and support are handled by the third-party merchant on its own website. We may earn an affiliate commission from a referral. Details.
Products of the Week.
Submit馃
Perceptle
Perceptle is a daily browser-based game that challenges you to test your sensory intuition through five quick estimation and rhythm-based rounds.
Other 路 1,489 views 路 9 clicksOther 路 Week 47 路 1,489 views 路 9 clicks
馃
Free LinkedIn Likes From Real
Get free LinkedIn likes on your posts from real members who react by hand. No
SaaS 路 1,632 views 路 10 clicksSaaS 路 Week 47 路 1,632 views 路 10 clicks
馃
STOP GUESSING WHAT TO POST
AI that learns your brand voice and builds a month of consistent, on-brand social content: carousels, posts and hooks that sound like you, not like everyone else's AI.
SaaS 路 9,176 views 路 75 clicksSaaS 路 Week 47 路 9,176 views 路 75 clicks
#4
aaas.market
407 reliable micro tools for solo founders, marketers and creators. They work in your browser
SaaS 路 1,597 views 路 5 clicksSaaS 路 Week 47 路 1,597 views 路 5 clicks