Untitled

mail@pastecode.io avatar
unknown
javascript
a year ago
507 B
2
Indexable
Never
 const generateCode = (amount, prefix, extension, idStart) => {
	
	for(i = 0; i <= amount; i++) {
		let code = i+1;
		if(code < 10) {
			code = `0${code}`;
		}
		console.log(`<div class = "img-item" >
  <a data-lightbox="mygallery" target="_blank" href="./img/${prefix}${code}.${extension}" data-pswp-width="2000" data-pswp-height="2000" id="main${idStart + i}">
    <img src = "./img/${prefix}${code}.${extension}" alt = "" id="img-scale-bottom" class="thumbnail">
  </a>
</div>`);
	
	}
 
 }