Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vanilla-infinite-marquee

Package Overview
Dependencies
Maintainers
0
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vanilla-infinite-marquee

Infinite Horizontal & Vertical Marquee animation based on CSS and controlled with JS

  • 1.0.12
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
305
increased by10.51%
Maintainers
0
Weekly downloads
 
Created
Source

Vanilla Infinite Marquee

npm npm downloads npm license

Installation

CDN Usage

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vanilla-infinite-marquee@1.0.12/infinite-marquee.min.css">
<script src="https://cdn.jsdelivr.net/npm/vanilla-infinite-marquee@1.0.12/infinite-marquee.bundle.js"></script>

If you're using npm, in the command prompt run:

npm install vanilla-infinite-marquee

If you're using yarn, run:

yarn add vanilla-infinite-marquee

Demo

Usage

To use the component, first import CSS styles into your CSS/SCSS file:

@import 'node_modules/vanilla-infinite-marquee/infinite-marquee.css'; //OR
@import 'node_modules/vanilla-infinite-marquee/infinite-marquee.scss';

Basic HTML Input

<div class="marquee-container">
    <p>Horizontal Marquee Item 1</p>
    <p>Horizontal Marquee Item 2</p>
</div>

import InfiniteMarquee into your JS file:

import InfiniteMarquee from 'vanilla-infinite-marquee';

new InfiniteMarquee({
	element: '.marquee-container',
	speed: 25000,
	smoothEdges: true,
	direction: 'right',
	gap: '15px',
	duplicateCount: 2,
	mobileSettings: {
		direction: 'top',
		speed: 20000
	},
	on: {
		beforeInit: () => {
			console.log('Not Yet Initialized');
		},

		afterInit: () => {
			console.log('Initialized');
		}
	}
});

Options

OptionTypeDefaultDescription
elementstring, NodenullSelector
directionstring"left"Direction of Marquee animation, "left", "right", "top", "bottom"
spaceBetweenstring"0px"Gaps to be used for "left" or "right" direction ONLY
gapobject{vertical: "5px", "horizontal: "0px" }Gaps to be used for "top" or "bottom" direction ONLY
speednumber10000Speed of animation in ms
smoothEdgesbooleanfalseWhether to smooth covered edges or not
fullContainerbooleantrueFill the full width of container(DESKTOP ONLY), for "left" or "right" direction ONLY
fullContainerWidthnumber100Full width container size with number value that later converts into percentage
pauseOnHoverbooleanfalsePause animation on hover
destroyOnDesktopbooleanfalseDestroy Marquee structure and animation on "Desktop"
destroyOnMobilebooleanfalseDestroy Marquee structure and animation on "Mobile"
debuggingbooleanfalseDebug in console each event of Marquee lifecycle
elementClassstringmarquee-containerClass of Container that will be used to destroy Marquee
duplicateCountnumber1Count of marquee be duplicated to show an effect of continuous flow
breakpointSizenumber991.8"max-width" breakpoint for responsive devices, accepted only single breakpoint
mobileSettingsobject{}Responsive options (works only for spaceBetween, gap, speed and direction properties)
onobject{}Object to contain callback functions below
beforeInitfunctionnullA callback function that invokes before marquee initialization
afterInitfunctionnullA callback function that invokes after marquee initialization
pauseAnimationfunctionnullA callback function that invokes on Pause
resumeAnimationfunctionnullA callback function that invokes on Resume

Keywords

FAQs

Package last updated on 06 Aug 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc