Skip to content

Instantly share code, notes, and snippets.

@linktohack
Created December 29, 2016 16:41
Show Gist options
  • Save linktohack/507067f2cae9428f204d3697fd6c0d7b to your computer and use it in GitHub Desktop.
Save linktohack/507067f2cae9428f204d3697fd6c0d7b to your computer and use it in GitHub Desktop.
Barcode generator
var blocks = magasins.map(m => {
var block = $(`
<div class="block" style="display: inline-block; border: 2px dotted grey; margin: 10px; border-radius: 5px;">
<p>${m.name}</p>
<img id=DB${m.pano} style="width: 200px">
</div>
`);
return block;
});
var all = $('<div>');
blocks.forEach(it => it.appendTo(all));
$('body').html(all)
magasins.forEach(m => {
$(`#DB${m.pano}`).JsBarcode(`DB${m.pano}`)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment