inherit
169267
0
Nov 20, 2024 16:39:46 GMT -8
Mike
Praise God Almighty!
1,534
July 2011
riccetts
|
Post by Mike on Jul 29, 2021 5:35:37 GMT -8
I have this Jquery code
var colors = ["red", "blue"];
var currentColor = 0;
function switchColor() {
if (currentColor >= colors.length) currentColor = 0;
$('body').css('background-color', colors[currentColor++]);
setTimeout(switchColor, 50);
}
Can I use this to change background image on the body? my css looks like this on my theme body{ background-image: radial-gradient(#3c7dc5, black); background-image:fixed; }
switchColor();
|
|
inherit
265132
0
Sept 29, 2021 23:44:09 GMT -8
willkaren
1
September 2021
willkaren
|
Post by willkaren on Sept 29, 2021 23:44:09 GMT -8
I have the same question. Can i use this to change the background? Let me know if you find out. Thanks in advance, Team Discordserverlists
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Dec 26, 2021 23:26:45 GMT -8
With the way the script is right now, the answer would be no.
If you don't mind having a random background, then add the following script to your Global Header. Add the link to the background image where it says.
Important: leave the \ at the end where it is, or the script won't function!
/* Random Forum Background Image or Color by SubDevo */ /* Global Header - Please leave this header intact. Do not repost. */ /* interoceandesigns.com or lsdp.proboards.com *
/* URL to Image */ var backgrounds=[ "\"ADD PATH TO BACKGROUND IMAGE HERE\"", "\"ADD PATH TO BACKGROUND IMAGE HERE\"", "\"ADD PATH TO BACKGROUND IMAGE HERE\"", "\"ADD PATH TO BACKGROUND IMAGE HERE\"", ];
/* Don't Touch the code below! */
var bg=backgrounds[Math.floor(backgrounds.length*Math.random())]; bg=(bg.indexOf("http:"))? "-image:url("+bg+")" : +bg; document.write("<style type='text/css'>body{background"+bg+"; background-size: 100% 100%; background-repeat: no-repeat;, }</sty"+"le>");
|
|