change background image at every refresh

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Locked
VixxeN
Registered User
Posts: 8
Joined: Tue Jan 29, 2019 2:25 pm

change background image at every refresh

Post by VixxeN » Fri May 10, 2019 5:24 pm

Hello, can someone teach me how to make a script to change background image at every refresh?
I mean, now I will acces the site, then I will refresh / visit a subforum/topic. When I will refresh / visit to get another background image.
For example:
Image
Image

I MUST MENTION THAT MY STYLE IS WE_UNIVERSAL!

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 3975
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: change background image at every refresh

Post by HiFiKabin » Fri May 10, 2019 5:49 pm


User avatar
Hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 889
Joined: Wed Dec 30, 2009 8:14 am
Name: Michael Miday
Contact:

Re: change background image at every refresh

Post by Hanakin » Fri May 10, 2019 6:39 pm

use this as a reference viewtopic.php?f=591&t=2511206

you need to create an array of the images and change the property from backgroundColor to backgroundImage
Donations welcome via Paypal Image

User avatar
Hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 889
Joined: Wed Dec 30, 2009 8:14 am
Name: Michael Miday
Contact:

Re: change background image at every refresh

Post by Hanakin » Fri May 10, 2019 7:42 pm

Im not in front of a development machine at the moment but its very easy though just search for javascript random page background and it should get you there.

https://css-tricks.com/snippets/php/ran ... und-image/

this is php but the concept is similar with javascript
Donations welcome via Paypal Image

Locked

Return to “[3.2.x] Styles Support & Discussion”