<divs>

Components
  • All
  • Carousel
    13 Variants
  • Marquee
    14 Variants
More coming... let me cook

Hi, I'm Idrees.

Founder of Mumino.

I built all components and this site's full stack myself, for fun. Imagine what we can do with a budget.

Book a Call

Connect

Work With Us

Made by Idrees Isse

Founder of Mumino, a digital design & development agency.

Available for hire.

@idreezus

FeaturesSetupHow It WorksResponsive DirectionsReversing DirectionHover EffectsSpacing & CSS GapsAuto-CloningVariantsGalleriesLogosTestimonialsCustomizationCore AttributesHover EffectsPerformanceJavaScript APIAccessibilityFAQ
Components

Marquee

An effortless marquee for seamless and responsive infinite looping.

0 Variants
GSAP
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.

Features

  • Seamless loops with no visible gaps or jumps
  • Auto-pauses when off-screen to save resources
  • Switches direction at breakpoints via CSS
  • Built-in pause and slow hover effects
  • Smart content cloning for continuous scrolling

Setup

Copy & paste this script Before </body>Copy tag.

HTML
<!-- GSAP Core -->
<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>
 
<!-- Divs Marquee Library -->
<script src="https://cdn.jsdelivr.net/gh/idreezus/divs@v1.0.0/dist/marquee/v1.0.0/marquee.min.js"></script>
Webflow folks: You might already have GSAP

On Webflow, you can enable GSAP site-wide by opening up your site and clicking Settings → GSAP → Enable GSAP. I recommend doing this if not already.

If you go this route, don't include the first script below for GSAP Core.

Skip this step if using one of the variants below.

Otherwise, mark your container with [data-marquee="true"]Copy and each item with [data-marquee-item="true"]Copy

HTML
<div data-marquee="true" class="my-marquee">
  <div data-marquee-item="true">Item 1</div>
  <div data-marquee-item="true">Item 2</div>
  <div data-marquee-item="true">Item 3</div>
</div>

Skip this step if using one of the variants below.

For horizontal scrolling, use display: flexCopy with flex-direction: rowCopy. For vertical scrolling, use display: flexCopy with flex-direction: verticalCopy and some kind of height constraint. Examples:

CSS
/* Horizontal marquee */
.my-marquee {
  display: flex;
  flex-direction: row;
  overflow: hidden;
  gap: 2rem;
}
 
/* Vertical marquee */
.my-vertical-marquee {
  display: flex;
  flex-direction: column;
  height: 24rem;
  overflow: hidden;
  gap: 1rem;
}

The marquee auto-initializes when the page loads.

How It Works

Everything about this component is based on the flexbox. This library was designed with Webflow's visual development in mind – I want to see how my marquee looks without surpises. You control the visual behavior by:

  • Control orientation simply by setting flex-directionCopy
  • Add space between items by using gapCopy
  • Size individual items using your typical CSS

The library handles the animation complexity behind the scenes, and GSAP powers the animation timelines and allows for fancy things like speed ramped hover effects.

But here's my favorite part: you can start off in one direction and automatically "flip" at any breakpoint. The library detects the switch and rebuilds the animation to match your new layout.

This came about because vertical infinite marquees are kinda obnoxious on mobile screens. With previous marquee libraries, if you wanted to swap directions at an arbitrary breakpoint, you'd have to duplicate your marquee twice and use display: hiddenCopy (meaning you really had two individual marquees that are shown/hidden at different times).

But that's hacky and pollutes the DOM. It's the type of thing that would've made Steve Jobs mad if he was a web developer (or alive).

Responsive Directions

Direction is controlled entirely through CSS flex-directionCopy. Here's an example of a responsive layout that goes from vertical → horizontal on smaller screens.

CSS
/* Vertical on desktop */
.my-marquee {
  display: flex;
  flex-direction: column;
  height: 36rem;
  overflow: hidden;
}
 
/* Switch to horizontal on mobile */
@media (min-width: 768px) {
  .my-marquee {
    flex-direction: row;
    height: auto;
  }
}
Tip

Use CSS gapCopy instead of margins for spacing. The library measures gaps to ensure seamless loops without visible seams.

The library detects uses ResizeObserverCopy to detect direction changes during window resize events and rebuilds the animation. Previous playback position is preserved proportionally, so users don't experience jarring jumps when resizing their browser or rotating their device.

Reversing Direction

To animate the marquee in the opposite direction, add [data-marquee="reverse"]Copy to the container element:

HTML
<div class="my-marquee" data-marquee="true" data-marquee-reverse="true">
  <!-- your items here -->
</div>

Hover Effects

Add interactive hover effects with simple attributes on your container element. All hover effects use smooth easing curves and customizable timing.

Slow Effect

To reduce speed to a slower sustained pace during hover, add [data-marquee-effect="slow"]Copy to the container element:

HTML
<div data-marquee="true" data-marquee-hover-effect="slow">
  <!-- your items here -->
</div>

Pause Effect

To ramp speed down to a complete stop when hovering, add [data-marquee-effect="pause"]Copy to the container element:

HTML
<div data-marquee="true" data-marquee-hover-effect="pause">
  <!-- your items here -->
</div>

Trigger Area

By default, hovering anywhere on the container triggers the effect. If you want the effect to only trigger when a specific item is hovered instead (maybe because you have huge gaps between items so the container has lots of "empty" space):

HTML
<div
  data-marquee="true"
  data-marquee-hover-effect="pause"
  data-marquee-hover-trigger="items"
>
  <!-- your items here -->
</div>

Spacing & CSS Gaps

The library measures spacing between items to ensure seamless loops. For reliable results, use the CSS gapCopy property on your container:

CSS
.my-marquee {
  display: flex;
  gap: 2rem; /* your spacing between items */
}

The library attempts to measure margins and padding, but gapCopy provides the most consistent and predictable spacing. The spacing calculation uses the median gap between items, which feeds into clone positioning and timeline duration to prevent visible seams at the loop point.

Auto-Cloning

To create infinite loops, items are cloned to create continuous loops. This is done automatically. The library smartly calculates the minimum amount of clones needed based on:

  • Container dimensions (width for horizontal, height for vertical)
  • Total content size
  • Spacing between items

Cloned elements are marked with [aria-hidden-"true"]Copy so screen readers announce the original content once without any of the clones.

Clone count is capped at 10 sets maximum for performance.

Disabling Auto-Clone

If you want to manage cloning manually:

HTML
<div data-marquee="true" data-marquee-auto-clone="false" class="my-marquee">
  <!-- manually duplicate your items here -->
</div>
Warning

Disabling auto-clone requires you to manually duplicate content enough times to fill the container and create a seamless loop. Use this only if you need precise control over the DOM structure.

Custom Clone Count

Override the automatic calculation:

HTML
<div data-marquee="true" data-marquee-clones="3" class="my-marquee">
  <!-- your items here -->
</div>

Variants

Galleries

Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note

For these next two ones, try resizing the frame to see how it automatically changes from vertical to horizontal at the mobile landscape breakpoint. Isn't that cool?

Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.

Logos

Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note

It's resize time again. Try resizing the frame to see it these vertical ones become horizontal at the mobile landscape breakpoint.

Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.

Testimonials

Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.
Note:Your window size is small – the preview may not be fully visible. Try checking it out on a larger screen.
Navigator
No node selected
Select a node from the Navigator to view its details, attributes, and styles.

Customization

Core Attributes

All configuration happens through data-marquee-*Copy attributes on the container element:

AttributeValuesDefaultDescription
data-marqueeCopy"true"Copy-Required to initialize the marquee
data-marquee-itemCopy"true"Copy-Required on each child element to animate
data-marquee-speedCopynumber0.6CopySpeed multiplier where 1.0 ≈ 100px/second (higher = faster)
data-marquee-reverseCopy"true"Copy-Reverses the animation direction
data-marquee-repeatCopynumber-1CopyNumber of loop cycles. -1Copy = infinite, 0Copy = play once, 5Copy = loop 5 times

Hover Effects

Fine-tune hover interactions with these attributes:

AttributeValuesDefaultDescription
data-marquee-hover-effectCopy"pause"Copy / "slow"Copy-Type of hover effect
data-marquee-hover-triggerCopy"container"Copy / "items"Copy"container"CopyWhere hover is detected
data-marquee-hover-speedCopy0-10.3Copy (slow)
0.1Copy (pause)
Target speed during hover as fraction of normal
data-marquee-hover-durationCopyseconds0.4CopyTotal ramp duration for pause effect
data-marquee-hover-inCopyseconds0.7CopySlow effect ramp-in duration
data-marquee-hover-outCopyseconds0.25CopySlow effect ramp-out duration
data-marquee-hover-ease-inCopyGSAP ease"power1.out"CopyRamp-in easing function
data-marquee-hover-ease-outCopyGSAP ease"power1.out"CopyRamp-out easing function

Performance

IntersectionObserver

By default, marquees pause when scrolled out of the viewport to improve performance. Control this behavior with:

AttributeValuesDefaultDescription
data-marquee-intersectionCopy"true"Copy / "false"Copy"true"CopyPause when out of viewport

Cloning Performance

Reduce clone count if you have many large items or complex layouts:

AttributeValuesDefaultDescription
data-marquee-auto-cloneCopy"true"Copy / "false"Copy"true"CopyEnable automatic cloning
data-marquee-clonesCopynumber (1-10)Auto-calculatedNumber of clone sets to append

JavaScript API

Control marquees programmatically through the global window.MarqueeCopy object. The library auto-initializes on page load, but you can also manage instances manually.

Initialization

JavaScript
// Initialize all marquees (called on DOMContentLoaded)
window.Marquee.init();
 
// Initialize with custom selector
window.Marquee.init(".custom-marquee-class");

Getting Instances

JavaScript
// Get single instance
const marquee = window.Marquee.get(element);
 
// Get all instances (returns array)
const allMarquees = window.Marquee.getAll();
 
// Check if element has a marquee
const hasMarquee = window.Marquee.has(element);

Control Methods

All batch methods are chainable:

JavaScript
// Instance control
const marquee = window.Marquee.get(element);
marquee.play();
marquee.pause();
marquee.destroy();
 
// Batch control
window.Marquee.pauseAll();
window.Marquee.playAll(".my-marquees");
window.Marquee.destroyAll(".old-marquees");
 
// Manual direction refresh (useful after dynamic CSS class changes)
window.Marquee.refresh(element);
window.Marquee.refreshAll();
 
// Chaining
window.Marquee.pauseAll(".slow").playAll(".fast").refreshAll();

Dynamic Content Updates

When adding or removing items after initialization, destroy and reinitialize:

JavaScript
const container = document.querySelector("[data-marquee]");
const instance = window.Marquee.get(container);
 
// Destroy existing instance
instance.destroy();
 
// Update content
container.innerHTML = "..."; // Add new items with data-marquee-item="true"
 
// Reinitialize
window.Marquee.init();
Important

If you change CSS classes that affect flex-directionCopy outside of a resize event, manually trigger window.Marquee.refresh(element)Copy to rebuild the animation with the new direction.

Accessibility

The library includes built-in accessibility features to ensure marquees work well for all users. Cloned items are marked with aria-hiddenCopy = "true"Copy so screen readers announce the original content once, preventing repetitive announcements. The library respects the prefers-reduced-motionCopy media query by reducing animation speed to 10% for users who have indicated a preference for reduced motion. All semantic HTML structure is preserved, ensuring assistive technologies can navigate and understand the content regardless of animation state.

FAQ

Why is my spacing inconsistent or showing gaps at the loop point?

When spacing between items, the library works best with the CSS gapCopy property. Use that while trying to avoid using margins and padding on the container or items. The library will try to measure margins and padding, but no guarantees.

Can I switch between horizontal and vertical at different breakpoints?

Yes. The marquee direction is controlled entirely by CSS flex-directionCopy so you can change it at any breakpoint. For example, use flex-direction: columnCopy on desktop and switch to flex-direction: rowCopy at a mobile breakpoint. The library will detect the change during resize and rebuilds the animation to match the new layout.

Why isn't my vertical marquee working?

Vertical marquees need a height constraint on the container. Use either heightCopy or max-heightCopy. As long as the total height of all cloned content exceeds the container's height, the marquee will work. Without a height constraint, the flex container expands to fit all content, leaving nothing to scroll.

I followed instructions but my marquee isn't working. What's wrong?

Check your browser console. The library logs clear warning messages when issues are detected (missing GSAP, invalid selectors, items with zero dimensions, incorrect CSS properties, etc). Failed instances are caught individually, so one problematic marquee won't prevent others from initializing. Each error message includes context about what went wrong and how to fix it.

What happens if I dynamically change the marquee's CSS class?

If the CSS class change affects flex-directionCopy, manually trigger window.Marquee.refresh(element)Copy to rebuild the animation. The library detects direction changes during window resize events, but dynamic class changes outside of resize require manual refresh.