I tried to figure this out for over a month now. I cannot get the image to be removed from the array once the image was clicked on 'x' on the previewer.
http://jsfiddle.net/ERZVC/2/
My attempt to use splice failed!
$('#list').on('click', '.remove_img_preview',function () {
$(this).parent('span').remove();
//this is not working...
var i = array.indexOf($(this));
if(i != -1) {
array.splice(i, 1);
}
// tried this too:
//$(this).parent('span').splice( 1, 1 );
count--;
});
please help me out!