← GO BACK HOME

RG-MAGE'S CODE SNIPPETS

Feel free to use... sharing is caring.

Random image on refresh

In the script, replace the placeholders in the array with links to your own images. There’s no limit on the amount of pictures, but make sure you put a comma after every path / url.

HTML

Change height and width to your taste or create a css class for this img element.

JS

Place this script at the bottom of your html page, right above < /body > tag.

Refresh page to see it work ;)

Image per day of the month

Create a folder named ‘cal-img’ in your root / home. Put 31 of your designated images in there and name them 1 - 31. Make sure all your images have the same file type (either png, gif or jpg).

HTML

Change height and width to your taste or create a css class for this img element.

JS

Place this script at the bottom of your html page, right above < /body > tag.

This image is called and
corresponds with the current day!