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

@digital-butlers/marquee

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digital-butlers/marquee

A convenient library with marquee for everyday tasks

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Marquee

Usage

Create an HTML markup

<section class="section" data-component-id="marquee">
		<div data-role="marquee-parent" >
			<div data-role="marquee-moving-line">
				<div data-role="marquee-list">
					<div class="card-wrapper">
						<div class="card">Card</div>
					</div>
					<div class="card-wrapper">
						<div class="card">Card</div>
					</div>
					<div class="card-wrapper">
						<div class="card">Card</div>
					</div>
				</div>
			</div>
		</div>
		<div class="container">
	</section>

Create marquee instance

const marquee = new Marquee({
marqueeParentSelector: '[data-role="marquee-parent"]',
	marqueeMovingLineSelector: '[data-role="marquee-moving-line"]',
	marqueeListSelector: '[data-role="marquee-list"]',
	wrapperOfVisiblePartOfMarquee: document.documentElement, // it is needed to measure the width of the visible part of the running line
	matchMediaRule: window.matchMedia('(min-width: 800px)'), // will prevent the tab changing if window.matchMedia doesn't match
});

marquee.init();

API

Config Properties

marqueeParentSelector

Type: string Default: '[data-role="marquee-parent"]' Description: The selector of the parent element for the moving line

marqueeMovingLineSelector

Type: string Default: '[data-role="marquee-moving-line"]' Description: Css selector to specify for the element that will be animated. "marquee-list" is a child element, relative to the "moving-line".

marqueeListSelector

Type: string Default: '[data-role="marquee-list"]' Description: Css selector, which is the direct parent for all images, texts, and other moving elements.

duration

Type: number Default: 10 Description: Determines the speed of the running line

divisibleNumber

Type: number Default: 0 Description: When creating copies of animated elements, the number from the variable "divisible Number" will be used. If it is greater than 0, then the total number of animated elements will be a multiple of "divisibleNumber".

matchMediaRule

Type: MediaQueryList Default: window.matchMedia('screen') Description: Prevents changing the accordions if the breakpoint does not match the window.matchmedia

wrapperOfVisiblePartOfMarquee

Type: HTMLElement Default: document.documentElement Description: Sometimes the infinite marquee should not span the full width of the screen, but rather the width of a smaller container. Pass the wrapper of the visible part of your marquee to the parameter "wrapperOfVisiblePartOfMarquee".

Events callback config object

beforeInit

Type: function Default: undefined Description: Callback will be started before marquee initialization

afterInit

Type: function Default: undefined Description: Callback will be started after marquee initialization

disable

Type: function Default: undefined Description: Callback will be started after disable marquee

update

Type: function Default: undefined Description: Callback will be started after update marquee

License

MIT

Keywords

FAQs

Package last updated on 24 Oct 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