GalleryPremium

Image Marquee

An endless ribbon of photos: each image fills its 150 × 100 px frame, cropped without being distorted, and the ribbon stops under the mouse.

CSSJSImages

Updated

This effect is part of Effect.Labs — 846 vanilla effects, some free, some premium. Gallery has 44 effects, including 6 free. Explore the category →

3 usage examples

Sheets of a digitised herbarium — top of the page of a horticultural society's library — Image Marquee example 1

① Sheets of a digitised herbarium — top of the page of a horticultural society's library

WhenOn the home page of the Valmérac Horticultural Library, under the heading and the “Search a species” field, six tall sheets pass slowly: bracken, ginkgo, lavender, anemone, maple, wild oat, each with its handwritten label.
WhyThe collection is shown before it is explained: you see the paper, the pressed plants, the labels. The tall frame (104 × 146 px) follows the format of the sheets, and resting the pointer on one holds the ribbon long enough to look at it.
Settingsdata-speed="52", --immq-item-width: 104px, --immq-item-height: 146px, --immq-space: 12px, --immq-bg: transparent, --immq-height: auto, --immq-padding: 0, --immq-button-size: 28px; corners brought down to 3 px and a light shadow on .immq-item.
Thumbnails of the stops in a sea-kayak route card — results of a hire company — Image Marquee example 2

② Thumbnails of the stops in a sea-kayak route card — results of a hire company

WhenAt Morvezen, each outing on offer (“Round the three islets”, “Up the estuary with the tide”) fits in a card: distance, duration, price, Book button, and a small row of 58 × 40 px thumbnails running through the five stops.
WhyFive photos fit in the width of three: the card stays low and the results compare at a glance. Two ribbons live in the same page, each with its own 22 px Pause button.
Settingsdata-speed="22", --immq-item-width: 58px, --immq-item-height: 40px, --immq-space: 6px, --immq-button-size: 22px, --immq-bg: transparent, --immq-height: auto, --immq-padding: 0; 6 px corners.
Winning photos, large, behind the entry form of a photo contest — astronomy magazine — Image Marquee example 3

③ Winning photos, large, behind the entry form of a photo contest — astronomy magazine

WhenOn the 2027 contest page of Orbelune magazine, last year's awarded night skies (Milky Way, aurora, full moon, comet) take the full height and glide behind the heading and the “Enter the contest” form.
WhyThe images set the expected level without taking room in the page. The heading and the form sit on a dark veil, above the ribbon: the mouse therefore does not stop it, only the Pause button, moved up into the corner, does.
Settingsdata-speed="48", --immq-item-width: 250px, --immq-item-height: 360px, --immq-height: 360px, --immq-space: 4px, --immq-padding: 0; border-radius: 0 on .immq-item, .immq-toggle set to position: absolute at the bottom left, over the veil.

How it works

Each .immq-item is a 150 × 100 px frame with 8 px rounded corners (--immq-item-width, --immq-item-height). The <img> you put inside takes all the room: object-fit: cover keeps its proportions and cuts what sticks out, left and right for a wide photo, top and bottom for a portrait. As long as no image is there, the frame shows an indigo gradient and whatever text you left in it.

Because the size comes from the frame and not from the photo, the length of the ribbon is known before the first download: nothing jumps when images arrive, even without width and height attributes. Five frames and their 2 rem gaps make 910 px; the script adds the duplicates needed to cover the area and sets the duration from data-speed, 45 px per second.

It is a ribbon, not a slideshow: no arrows, no active image, no finger dragging. The photos travel on their own; resting the mouse on them, or the round button, holds them.

Accessibility

  • Alternative text: write one alt per photo. The duplicates added by the script carry aria-hidden="true", so each image is announced only once. For a purely decorative ribbon, leave alt="".
  • Pause: a button with aria-pressed at the end of the ribbon, triggered by click, finger, Space or Enter. Photos that move for more than five seconds must be stoppable (WCAG 2.2.2).
  • Clickable frames: write <a class="immq-item">; with the keyboard, the frame reached is marked by a double ring, white then dark, drawn inside it, readable on a light photo as on a dark one. The ring stays whole, and a mouse click does not make the ribbon jump: the frame you aimed at is the one that opens.
  • No motion: if the user asked for fewer animations, the ribbon stays on its original photos, with no duplicates and no button, and is unrolled by hand or with the arrow keys.

Browser compatibility

object-fit: cover (Chrome 32, Firefox 36, Safari 10), one CSS animation and 5 KB of script with no dependency. The double focus ring needs :focus-visible (Chrome 86, Firefox 85, Safari 15.4). Measured on 4 December 2026 in Chromium, Firefox and WebKit with real <img> tags: a 150 × 100 px image in a 150 × 100 frame, full ribbon at 390 and 1,900 px, two independent ribbons, no error.

Chrome 86+✓ Full (measured)
Firefox 85+✓ Full (measured)
Safari 15.4+✓ Full (WebKit engine measured)
Edge 86+✓ Full (Chromium engine)
iOS Safari 15.4+✓ Not verified on a device
Android Chrome 86+✓ Full (emulated touch, measured)

Script blocked: the photos line up once, still, in a row you scroll by hand. Older browser: the ribbon runs, so does the cropping; only the focus ring falls back to the browser's own.

The code

HTML structure to paste into your page (the CSS + JS come with your purchase):

index.html — structure
<div class="fx-0190-root" data-speed="45" data-direction="left">
  <div class="immq-band">
    <div class="immq-viewport">
      <div class="immq-track">
        <ul class="immq-group" role="list">
          <li><div class="immq-item"><img src="photo-1.jpg" alt="Description of the photo"></div></li>
          <li><a class="immq-item" href="/gallery"><img src="photo-2.jpg" alt="Description of the photo"></a></li>
        </ul>
      </div>
    </div>
    <button type="button" class="immq-toggle" aria-pressed="false" aria-label="Pause"></button>
  </div>
</div>

One-time payment, no subscription — the code is yours forever

Customize

Options passed to the API or data-* attributes:

Option / propertyDefaultEffect
--immq-item-width / --immq-item-height 150px / 100px Frame format, hence the cropping: 3:2 by default, taller than wide for portraits.
--immq-space 2rem Distance between two frames.
Frames (HTML — .immq-item inside each <li>) 5 “Image N” frames One <img> per frame, as a <div> or a link <a>; written only once.
.immq-item { border-radius } 8px Corner rounding, to change in your stylesheet: 0 for edge-to-edge photos, 50% with a square frame for medallions.
data-speed / data-direction 45 / left Pace in pixels per second; right reverses the direction.
--immq-height / --immq-bg / --immq-padding 180px / #0a0a0f / 1rem 0 Minimum height, background and padding of the block around the ribbon.
--immq-button / --immq-button-size rgba(255, 255, 255, .8) / 2rem Colour and size of the round button.

FAQ

How the image is treated. In Logo Ticker, the logo is shown whole, capped at 60% of the height of a tinted box that lights up on hover. Here the photo covers the entire frame, even if that crops it, with no border, no tint and no highlight: Logo Ticker for brands to recognise, Image Marquee for photos to look at.
No, cropped. The centre of each photo is kept, what sticks out of the frame is cut. If a subject is off-centre, add object-position on that image (for example object-position: 50% 20% to keep a face near the top), or give the frame the format of your photos with the two size variables.
No: it moves on its own and does not listen for dragging. It only becomes scrollable by hand in two cases, when the user asked for fewer animations and when the script did not run. For a real photo-by-photo walk-through, pick a slideshow from this category.