Phox Elements
MEDIA Random images for Breakdance

Show a different image on every visit

Random Image picks one image at random from a set you choose and shows it on the page. Each time the page loads, visitors may see a different picture. Size, crop and border it like a normal image element.

Pick as many images as you like Works with page caching Aspect ratio and object fit controls
Live demos

Reload the page to see new images

Each demo below is a Random Image with its own set of photos: a hero banner, a menu tile, a round photo and a gallery grid. Press Reload the page, or refresh your browser, and each one picks again.

Tip: every image below is picked at random when the page loads.
Hero banner

A new view every visit for a walking holiday company

Five landscape photos, Aspect Ratio 16:9, Object Fit cover and a 16px radius. The text sits on top in its own layer.

Farway Walking Holidays

Guided walks on coast and mountain paths

Small groups, local guides and your bags carried between inns.

Menu tile

From our kitchen today

Three dish photos, Aspect Ratio 1:1, Object Fit cover and a 20px radius.

Harbour Kitchen Lunch is served from 12:00 to 15:00. Ask about today's specials at the counter.

Round photo

Meet one of our regulars

Five pet photos, Aspect Ratio 1:1, a 50% radius and a 6px lilac border to make a circle.

Pawprint Grooming A different happy customer each time you visit.

Gallery grid

Three tiles, each picking its own photo

Three Random Image elements with the same five pottery photos. Aspect Ratio 4:3 and a 12px radius. Each tile picks on its own, so two tiles can show the same photo.

How it works

Three steps to a random image

As simple as adding a normal image.

1

Add the element

Drop Random Image where you want the picture to appear.

2

Choose your images

Select as many images as you like from the media library.

3

Set the size

Choose a width, height, aspect ratio and object fit, and add borders if you want them.

Features

What you get

A small element that keeps pages feeling fresh.

Any number of images

Select as many images as you like from the media library.

New pick on each load

An image is chosen at random every time the page loads.

Cache friendly

The random pick happens in the browser, so it still changes on cached pages.

Aspect ratio

Use 1:1, 4:3, 3:2, 16:9, 8:5 or a custom ratio so every image fits the same space.

Object fit

Choose cover, contain or fill to control how each image sits in its box.

Width and height

Set the width and height like any other image.

Borders

Add borders and rounded corners.

Lazy load

Turn on lazy loading to help page speed.

Use it many times

Place several on one page, each with its own set of images.

Use cases

Where it works best

Anywhere a little variety helps.

01

Hero images

Rotate the main image on your homepage.

02

Testimonials

Show a different customer photo on each visit.

03

Portfolio teasers

Show a random piece of work each time.

04

Adverts and banners

Rotate promotional banners without a slider.

05

Team pages

Show a random team photo in a sidebar.

06

Galleries

Build a grid where every tile can change.

Settings reference

Every control, explained

This is the full list of settings in the Breakdance editor.

ControlWhat it doesDefault
Content
ImagesChoose the images to pick from.—
Lazy LoadLoad the image only when it is near the screen.—
Design
WidthImage width.—
HeightImage height.—
Aspect Ratio1:1, 4:3, 3:2, 16:9, 8:5 or Custom, with custom width and height.—
Object FitCover, Contain or Fill.—
BordersBorders and corner radius.—
Tips & FAQ

Good to know

Does it work with caching plugins?

Yes. The image is picked in the visitor's browser when the page loads, so cached pages still show a random image.

Can the same image show twice in a row?

Yes. Each load is a fresh random pick, so the same image can come up again, especially with a small set.

How do I stop images jumping in size?

Set an aspect ratio and use Object Fit cover so every image fills the same space.

Can I use several on one page?

Yes. Each Random Image makes its own pick, as the demos on this page show.

Add Random Image to your next page

Random Image is included with Phox Elements, along with 140+ other premium elements for Breakdance.