1
I have this screen to insert images in the system, the part of the insertion works right, only I want that when clicking an image, appear the edit button as in the image, and if you click again on this image, I want the button sum, I saw this so-called bootstrap Collapse, and I decided to try, but I’m not getting to make it work
what I did was this, html is created dynamically as in the code below:
var reader = new FileReader();
reader.onload = (function(imageFile){
return function(e){
//Render Thumnails
var li = $('<li/>',{class:"col-xs-12 col-sm-6 col-md-3 col-lg-3"});
var a = $('<a/>',{
href:"javascript:void(0)",
class:"thumbnail"
});
var button = $('<button/>',{
class:"btn btn-success collapse",
type:"button",
id:"teste",
html:"Editar"
});
var image = $('<img/>',{
toggle:"collapse",
target:"#teste",
src:e.target.result,
title:escape(imageFile.name)
}).appendTo(a).click(function(){
$('#imageList').data('current', $(this).attr('src'));
//alert($(this).attr('src'));
image_x = ($(this).attr('src'));
li.append(button).appendTo($('#imageList'));
});
li.append(a).appendTo($('#imageList'));
}
})(f);
use the on with what? with the click or with the toggle? I could not understand this well for my case...
– alexandre9865