diff --git a/DuckDuckGo Images Slideshow.user.js b/DuckDuckGo Images Slideshow.user.js index 6ce02f2..2dca45a 100644 --- a/DuckDuckGo Images Slideshow.user.js +++ b/DuckDuckGo Images Slideshow.user.js @@ -10,6 +10,24 @@ (function() { '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() { if(document.getElementById('slideshow_button') == null) { var slideshowLi = document.createElement('li'); @@ -43,23 +61,6 @@ if(tab.classList.contains('is-active')) { 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() { var testimages = document.querySelectorAll('img'); var testcount = testimages.length;