move init function up

This commit is contained in:
Brian Buller 2021-01-21 10:55:54 -06:00
parent 5dffa7bb5c
commit bf629f95c5

View File

@ -10,6 +10,24 @@
(function() { (function() {
'use strict'; 'use strict';
var init = function() {
console.log("Starting Slideshow");
lb.style.textAlign = 'center';
lb.style.height = '100%';
lb.style.width = '100%';
lb.style.position = 'fixed';
lb.style.top = '0px';
lb.style.left = '0px';
lb.style.zIndex = '99999';
lb.style.backgroundColor = 'rgba(0, 0, 0, 0.85)';
document.body.prepend(lb);
lbimg.style.objectFit = 'cover';
lb.append(lbimg);
running = true;
showImage(0);
}
var addSlideshowButton = function() { var addSlideshowButton = function() {
if(document.getElementById('slideshow_button') == null) { if(document.getElementById('slideshow_button') == null) {
var slideshowLi = document.createElement('li'); var slideshowLi = document.createElement('li');
@ -43,23 +61,6 @@
if(tab.classList.contains('is-active')) { addSlideshowButton(); } if(tab.classList.contains('is-active')) { addSlideshowButton(); }
tab.addEventListener('click', addSlideshowButton); tab.addEventListener('click', addSlideshowButton);
var init = function() {
console.log("Starting Slideshow");
lb.style.textAlign = 'center';
lb.style.height = '100%';
lb.style.width = '100%';
lb.style.position = 'fixed';
lb.style.top = '0px';
lb.style.left = '0px';
lb.style.zIndex = '99999';
lb.style.backgroundColor = 'rgba(0, 0, 0, 0.85)';
document.body.prepend(lb);
lbimg.style.objectFit = 'cover';
lb.append(lbimg);
running = true;
showImage(0);
}
function updateImages() { function updateImages() {
var testimages = document.querySelectorAll('img'); var testimages = document.querySelectorAll('img');
var testcount = testimages.length; var testcount = testimages.length;