как удалить фото из превью?
Доброе утро.
Я сделал превью картинок перед загрузкой. Вот код: <input type="file" name="file[]" multiple="true" id="files" /> <div id="images"></div> var reader = new FileReader(), i=0, numFiles = 0, imageFiles; // use the FileReader to read image i function readFile() { reader.readAsDataURL(imageFiles[i]) } // define function to be run when the File // reader has finished reading the file reader.onloadend = function(e) { // make an image and append it to the div var image = jQuery('<img style="width:100px; height:inherit; margin:3px;">').attr('src', e.target.result); jQuery(image).appendTo('#images'); // if there are more files run the file reader again if (i < numFiles) { i++; readFile(); } }; jQuery('#files').change(function() { imageFiles = document.getElementById('files').files // get the number of files numFiles = imageFiles.length; readFile(); }); Теперь пытаюсь сделать удаление изображений из превью. Помогите пожалуйста, очень горит. Заранее спасибо |
Походу никто не сможет помочь?
|
Mukhtar, просто удалить их по нажатию на кнопку или что?
пробегитесь по всем тегам img в div id="images" и удалите ну или просто очистите div |
Часовой пояс GMT +3, время: 18:45. |