User:Greenitthe/timeless.js: Difference between revisions
From IdleOn MMO Wiki
imported>Greenitthe No edit summary |
imported>Greenitthe No edit summary |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
var images = ['https://static.miraheze.org/idleonwiki/ | var images = ['https://static.miraheze.org/idleonwiki/b/b0/14bg.png', 'https://static.miraheze.org/idleonwiki/3/31/RedCaveBG.png', 'https://static.miraheze.org/idleonwiki/0/07/Desert_bg1.png', 'https://static.miraheze.org/idleonwiki/2/24/NightDesertBG.png', 'https://static.miraheze.org/idleonwiki/a/a2/Galaxybg.png']; | ||
document.getElementById('mw-content-container'). | var bgElemStyle = document.getElementById('mw-content-container').style | ||
bgElemStyle.background = ('url(' + images[Math.floor(Math.random() * images.length)] + ') no-repeat center center fixed'); | |||
bgElemStyle.webkitBackgroundSize = 'cover'; | |||
bgElemStyle.mozBackgroundSize = 'cover'; | |||
bgElemStyle.oBackgroundSize = 'cover'; | |||
bgElemStyle.backgroundSize = 'cover'; |
Latest revision as of 19:28, 18 November 2020
var images = ['https://static.miraheze.org/idleonwiki/b/b0/14bg.png', 'https://static.miraheze.org/idleonwiki/3/31/RedCaveBG.png', 'https://static.miraheze.org/idleonwiki/0/07/Desert_bg1.png', 'https://static.miraheze.org/idleonwiki/2/24/NightDesertBG.png', 'https://static.miraheze.org/idleonwiki/a/a2/Galaxybg.png'];
var bgElemStyle = document.getElementById('mw-content-container').style
bgElemStyle.background = ('url(' + images[Math.floor(Math.random() * images.length)] + ') no-repeat center center fixed');
bgElemStyle.webkitBackgroundSize = 'cover';
bgElemStyle.mozBackgroundSize = 'cover';
bgElemStyle.oBackgroundSize = 'cover';
bgElemStyle.backgroundSize = 'cover';