imapi/libs/j/ImageListSelection

17 lines
712 B
Plaintext
Raw Normal View History

function ImageListSelection(position,count) {
count = "number" == typeof count ? count : window.g_Gallery.pageCount;
var selection = window.curGallery.imageList.slice(position,position+count);
2019-04-21 08:15:22 -06:00
window.curGallery.container.list.innerHTML = "";
selection.forEach( function (e,i) {
var element = elementPlace("#ImageList",e,"thumbnail","li");
element.innerHTML = e;
element.style.backgroundImage = "url("+window.api_url+"?i!"+e+"!"+window.curGallery.Name+"!thumb)";
element.style.backgroundRepeat = "no-repeat";
element.style.backgroundPosition = "center center";
element.onclick = function () {
initImage(window.curGallery.Position+i,window.curGallery.Name);
};
element.innerHTML = e;
});
}