they are so beautiful that you want a different image to appear each time a user refreshes your website. You have been pondering on how to achieve this effect when it suddenly pop into your head to make a google search and it landed you here.
- Login to ypur cpanel/ftp
- Create a new folder “elitesbg” in your public html.
- Assuming you have created 3 amazing images kindly save them in this format: “1.jpg” “2.jpg” “3.jpg” and copy this images to elitesbg you have created earlier.
- Login to your admin dashbord
- Goto Settings and click on Main Settings.
- Click on Page Settings
- In the custom head code, add the following code:
- Then copy the following code into custom tail code:
In the above code: variable totalCount is number of backgrounds. The Math.random() method returns a random number between 0 and 1 and the Math.ceil() method rounds a number towards to the nearest integer, and returns the result.
Note: Your images must be in .jpg format
Any difficulty? Post your comments.
- TAGS :
Recieve Free Email Updates!
Subscribe to get new updates instantly delivered to your inbox. Select the specific category you want to recieve updates on and enter your email address below.
*A confirmation message will be sent to you, login to your e-mail account and click on the confirmation link to start enjoying this service.
Get the latest news on your Android mobile, Download our Android App