Repository navigation
Blocks Scroll Marquee
Block name: designsetgo/scroll-marquee
Category: DesignSetGo
Keywords: scrolling, gallery, images, parallax, scroll, infinite
The Scroll Marquee block (titled "Scrolling Gallery" in the inserter) displays one or more rows of images that scroll horizontally as the user scrolls the page. Each row has an independent scroll direction (left or right), creating an alternating parallax gallery effect. Images in each row are seamlessly duplicated six times internally so the scroll loop is continuous.
Authors manage images directly on the canvas in the block editor — clicking "Add Images" opens the Media Library with multi-select, and individual images can be removed with a single click. Each row has a direction toggle button on the canvas.
Key Features:
- Multiple independent rows, each with a configurable scroll direction (left or right)
- Scroll-speed control: how fast rows move relative to page scroll
- Configurable image dimensions (height, width) and border radius
- Independent gap between images within a row and gap between rows
- Click-and-drag and mouse-wheel interaction for manual browsing (added in v1.2.0)
- Images duplicated 6× in the HTML for a seamless infinite loop
- Scroll animation runs only when the block is in the viewport (IntersectionObserver)
- Respects
prefers-reduced-motion— no animation when the user opts out - Full Block Supports: background color, text color, gradients, block gap, anchor
| Attribute | Type | Default | Description |
|---|---|---|---|
rows |
array | One row, direction left, no images |
Array of row objects. Each row has images (array of {id, url, alt}) and direction ("left" or "right"). |
scrollSpeed |
number | 0.5 |
Multiplier applied to window.scrollY. Higher values move rows faster. Range: 0.1–2. |
imageHeight |
string | "200px" |
CSS height of every image in the gallery. |
imageWidth |
string | "auto" |
CSS width of every image in the gallery. |
objectFit |
string | "cover" |
object-fit applied to every image: cover, contain, fill, or scale-down. |
gap |
string | "20px" |
Gap between images within a row. |
rowGap |
string | "20px" |
Gap between rows. |
Border radius is not a custom attribute — it's the native Border support (style.border.radius), applied to every image via the block's selectors.border.
All controls live in a single Settings panel with per-control reset and a global "Reset all" button.
- Scroll Speed — RangeControl (0.1–2, step 0.1, default 0.5). Controls how many pixels rows translate per pixel of page scroll. Higher values create a more dramatic parallax.
-
Image Height — UnitControl. Default
200px. Sets the fixed height for all images. -
Image Width — UnitControl. Default
auto. Sets the fixed width for all images. -
Object Fit — Select control (
cover,contain,fill,scale-down). Defaultcover. Controls how each image fills its box. -
Gap Between Images — UnitControl. Default
20px. Horizontal space between images within a row. -
Gap Between Rows — UnitControl. Default
20px. Vertical space between rows.
A performance notice in the panel displays the total image count (images × 6 duplicates). A warning appears when total source images exceed 20.
Border radius for the images is set via the native Style → Border support, not a control in this panel.
Row management and image selection happen directly on the block canvas rather than in the sidebar:
-
Direction Toggle — Each row has a button ("← Scroll Left" / "Scroll Right →") that flips
directionbetweenleftandright. - Add Images / Add More Images — Opens the Media Library with multi-select. Replaces the existing image list for that row with the full selection.
- Remove Image — A close button on each image thumbnail removes it from the row.
- Add Row — A primary button at the bottom of the block appends a new row. New rows alternate direction automatically (even rows left, odd rows right).
- Remove Row — A close button on each row removes it entirely.
{
"rows": [
{
"images": [
{"id": 10, "url": "/wp-content/uploads/img1.jpg", "alt": "Mountain vista"},
{"id": 11, "url": "/wp-content/uploads/img2.jpg", "alt": "Forest path"}
],
"direction": "left"
},
{
"images": [
{"id": 12, "url": "/wp-content/uploads/img3.jpg", "alt": "Coastal cliffs"},
{"id": 13, "url": "/wp-content/uploads/img4.jpg", "alt": "Desert dunes"}
],
"direction": "right"
}
],
"scrollSpeed": 0.5,
"imageHeight": "220px",
"imageWidth": "330px",
"objectFit": "cover"
}Set imageHeight to "320px" and imageWidth to "240px" for portrait-oriented images, and lower scrollSpeed to 0.2 for a subtler effect.
The block ships a view.js frontend script that initializes on DOMContentLoaded (with a load event fallback).
For each .dsgo-scroll-marquee element on the page the script:
- Reads
data-scroll-speedfrom the wrapper element. - Measures each row's track-segment width and gap to calculate the loop range.
- On every
scrollevent (throttled viarequestAnimationFrame), computestranslateXfor each row track: rows withdata-direction="left"move negative; rows withdata-direction="right"move positive, offset so they start off-screen to the left. - Applies a modulo wrap so the translate value never grows unbounded, producing a seamless infinite loop.
- Uses
IntersectionObserverto pause updates when the block is not visible, conserving CPU.
Click-and-drag: The cursor changes to a grab hand on the block. Pointer events capture drag deltas and apply them as a manualOffset in addition to scroll position, so users can manually swipe through images.
Mouse wheel: Horizontal wheel events (and shift+wheel) adjust manualOffset and prevent default page scroll while the wheel is over the block. Vertical-only scroll passes through normally.
Reduced motion: When prefers-reduced-motion: reduce is set, the script exits immediately after initialization and the CSS resets any transform to none, displaying images in their natural static layout.
The saved HTML renders each row's images inside six identical .dsgo-scroll-marquee__track-segment elements (the duplication that enables infinite looping).
- All images must have alt text set in the Media Library or entered when uploading. The block saves
altper image; empty alt text is preserved asalt=""for decorative images. - Images are marked
loading="lazy"on save. - The block respects
prefers-reduced-motion: when the user has enabled this system preference, all rows display statically with no scrolling animation. - The draggable interaction is pointer-based; the gallery content remains readable without interaction.
-
Slider (
designsetgo/slider) — Use when you need navigation controls, auto-play, or per-slide rich content (headings, buttons, etc.) rather than a pure image gallery. -
Scroll Slides (
designsetgo/scroll-slides) — Vertical scroll-driven section transitions; use when the scroll interaction should advance full-page sections rather than an image strip.
DesignSetGo v1.0.0+ | WordPress 6.4+ Click-drag and mouse-wheel scroll interactions added in v1.2.0.
Auto-generated from
docs/blocks/SCROLL-MARQUEE.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2