![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
infinite-marquee
Advanced tools
Configurable package to create an infinite marquee effect. Animated with JS or CSS.
Configurable package to create an infinite marquee effect. Animated with either CSS or JS.
npm i infinite-marquee
# or
yarn add infinite-marquee
<div class="marquee">
<div class="marquee-inner">
<div class="marquee-content">EXAMPLE</div>
</div>
</div>
OR
@import 'infinite-marquee/assets/css/infinite-marquee
import InfiniteMarquee from 'infinite-marquee'
new InfiniteMarquee()
Option | Type | Default | Description |
---|---|---|---|
el | HTMLElement | document.querySelector('.marquee') | Container element. |
direction | string | left | Animation direction. |
duration | number | 5 | Animation duration in seconds. |
css | boolean | true | Whether to animate using CSS. If false GSAP will be used. |
disableResize | boolean | false | Disable internal window resize event so an external one can be used. |
Method | Description |
---|---|
onResize | Call the internal resize method. |
update | Recaculate DOM. |
Method | Description |
---|---|
animation | With {css: false} this will return a GSAP fromTo instance that can be controlled using all of GSAPs methods. |
<div class="marquee my-marquee">
<div class="marquee-inner">
<div class="marquee-content">
EXAMPLE
</div>
</div>
</div>
import InfiniteMarquee from 'infinite-marquee'
new InfiniteMarquee({
el: document.querySelector('.my-marquee')
direction: 'right',
duration: 5
})
For if you would like to batch resizes using an external resize event.
⚠️ I recommend using a debounce on an external resize to maximise performance. Internally this package uses the lodash debounce utility.
import InfiniteMarquee from 'infinite-marquee'
const marquee = new InfiniteMarquee({
disableResize: true
})
window.addEventListener(
'resize',
() => {
marquee.onResize()
},
{ passive: true }
)
⚠️ If your content DOM is modified after load e.g. fonts, images being lazyloaded. Please look into initialising your instance after these have loaded OR calling the
update
method to recalculate the marquee. Below are some package recommendations that might help with this.
FAQs
Configurable package to create an infinite marquee effect. Animated with JS or CSS.
The npm package infinite-marquee receives a total of 153 weekly downloads. As such, infinite-marquee popularity was classified as not popular.
We found that infinite-marquee demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.