mirror of
https://forge.murkfall.net/bluesaxman/imapi.git
synced 2026-03-13 10:54:19 -06:00
initial git commit of imapi
This commit is contained in:
47
libs/j/initGalery
Normal file
47
libs/j/initGalery
Normal file
@@ -0,0 +1,47 @@
|
||||
function initGalery(galleryName) {
|
||||
window.curGallery = {};
|
||||
getImageList(window.api_url, galleryName);
|
||||
window.curGallery.Position = 0;
|
||||
window.curGallery.Name = galleryName;
|
||||
window.curGallery.back = elementPlace("body","ImageGallery_back",null,"div");
|
||||
window.curGallery.container = elementPlace("#ImageGallery_back","ImageGallery",null,"div");
|
||||
window.curGallery.controls = elementPlace("#ImageGallery",null,"controls","div");
|
||||
window.curGallery.controls.previous = elementPlace(".controls",null,"previous button","div");
|
||||
window.curGallery.controls.previous.innerHTML = "Previous";
|
||||
window.curGallery.controls.previous.onclick = function () {
|
||||
window.curGallery.controls.previous.innerHTML = "";
|
||||
if (window.curGallery.Position < 10) {
|
||||
window.curGallery.Position = 0;
|
||||
} else {
|
||||
window.curGallery.Position -= 5;
|
||||
window.curGallery.controls.previous.innerHTML = "Previous";
|
||||
}
|
||||
window.curGallery.controls.next.innerHTML = "Next";
|
||||
window.curGallery.controls.position.innerHTML = window.curGallery.Position + " - " + (window.curGallery.Position + 5) + " / " + window.curGallery.imageList.length;
|
||||
ImageListSelection(window.curGallery.Position);
|
||||
};
|
||||
window.curGallery.controls.position = elementPlace(".controls","position",null,"div");
|
||||
window.curGallery.controls.position.innerHTML = window.curGallery.Position + " - " + (window.curGallery.Position + 5);
|
||||
window.curGallery.controls.next = elementPlace(".controls",null,"next button","div");
|
||||
window.curGallery.controls.next.innerHTML = "Next";
|
||||
window.curGallery.controls.next.onclick = function () {
|
||||
window.curGallery.controls.next.innerHTML = "";
|
||||
if (window.curGallery.Position >= window.curGallery.imageList.length - 10) {
|
||||
window.curGallery.Position = window.curGallery.imageList.length - 5;
|
||||
} else {
|
||||
window.curGallery.Position += 5;
|
||||
window.curGallery.controls.next.innerHTML = "Next";
|
||||
}
|
||||
window.curGallery.controls.previous.innerHTML = "Previous";
|
||||
window.curGallery.controls.position.innerHTML = window.curGallery.Position + " - " + (window.curGallery.Position + 5) + " / " + window.curGallery.imageList.length;
|
||||
ImageListSelection(window.curGallery.Position);
|
||||
};
|
||||
window.curGallery.controls.close = elementPlace(".controls",null,"close button","div");
|
||||
window.curGallery.controls.close.innerHTML = "Close";
|
||||
window.curGallery.controls.close.onclick = function () {
|
||||
var node = window.curGallery.back;
|
||||
node.parentNode.removeChild(node);
|
||||
};
|
||||
window.curGallery.container.list = elementPlace("#ImageGallery","ImageList",null,"ul");
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user