No domino mucho javascript, por lo que no entiendo mucho el codigo, ¿Donde tendria que poner el espaciado? y como
Código:
<script type="text/javascript">
<!--
num=0;
var files;
function crear(src,name,num) {
fi = document.getElementById('fiel');
contenedor = document.createElement('span');
contenedor.id = 'div'+num;
fi.appendChild(contenedor);
var newImage = document.createElement("img");
newImage.src = src;
newImage.height = 75;
contenedor.appendChild(newImage);
}
function handleFileSelect(evt) {
document.getElementById('fiel').innerHTML="";
var num=0;
files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if (!f.type.match('image.*')) {
continue;
}
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile){
return function(e){
crear(e.target.result,theFile.name,num);
num++;
};
})(f);
// Read in the image file as a data URL.
reader.readAsDataURL(f);
}
}
-->
function loading(){
document.getElementById('files').addEventListener('change', handleFileSelect, false);
}
</script>
<!--
num=0;
var files;
function crear(src,name,num) {
fi = document.getElementById('fiel');
contenedor = document.createElement('span');
contenedor.id = 'div'+num;
fi.appendChild(contenedor);
var newImage = document.createElement("img");
newImage.src = src;
newImage.height = 75;
contenedor.appendChild(newImage);
}
function handleFileSelect(evt) {
document.getElementById('fiel').innerHTML="";
var num=0;
files = evt.target.files; // FileList object
// Loop through the FileList and render image files as thumbnails.
for (var i = 0, f; f = files[i]; i++) {
// Only process image files.
if (!f.type.match('image.*')) {
continue;
}
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = (function(theFile){
return function(e){
crear(e.target.result,theFile.name,num);
num++;
};
})(f);
// Read in the image file as a data URL.
reader.readAsDataURL(f);
}
}
-->
function loading(){
document.getElementById('files').addEventListener('change', handleFileSelect, false);
}
</script>