1
Good evening, I’m using this plugin: http://ashleydw.github.io/lightbox/#single-image
Here is JSFIDDLE: https://jsfiddle.net/DTcHh/30015/
Follows the code:
HTML:
<button type="button" class="btn btn-primary">Abrir imagem</button>
JS:
$("button[class='btn btn-primary']").click(function(e) {
var imagem = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAM ... etc'
event.preventDefault();
$(this).ekkoLightbox({
//Como carregar imagem a partir daqui
});
});
It is possible to load image from javascript ?
Just create the img element and set the src attribute to base text 64.
– Woss