npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ngx-marquee

v13.2.1

Published

Powerful Marquee for Angular (based on observers behavior)

Downloads

12,226

Readme

ngx-marquee

Powerful Marquee Component for Angular (based on observers behavior). Improved alternative to the deprecated HTML marquee tag.

Donate

This library was generated with Angular CLI.

How to install

Run npm i ngx-marquee to install the library.

How to use

Import Module

import { NgxMarqueeModule } from 'ngx-marquee';

@NgModule({
  imports: [ NgxMarqueeModule ],
  ...
})
export class AppModule { }

Use Component

<ngx-marquee>
  <mark class="ticker-custom">My ticker content</mark>
</ngx-marquee>

Demo

Resume properties

| Name | Type | Description | | :--- | :----: | :--- | | [direction] | string | Sets the controlling direction of marquee movement. | | [duration] | string | Sets the length of time that an animation takes to complete one cycle. | | [pauseOnHover] | boolean | Set to pause the marquee movement while hover user event. |
| [animation] | string | Sets animation entrance when the marquee cycle starts. | | [pendingUpdates] | boolean | Indicates that taskOnUpdateContent callback function will be executed when the current movement cycle has been finished. | | [taskOnUpdateDuration] | function | Callback function to be used to determine the new duration value that an animation takes to complete the next cycle. This callback function will be executed if pendingUpdates property is set on true and the current cycle of marquee movement has been finished. | | [taskOnUpdateContent] | function | Callback function to be used to set new content in the next cycle. This callback function will be executed while pendingUpdates property is set on true and the current cycle of marquee movement has been finished. | | (pendingUpdatesChange) | boolean | This event indicates that the taskOnUpdateDuration or taskOnUpdateContent callbacks functions have been executed. | | (playStateChange) | MarqueeState | This event indicates the current state movement of the marquee. |

Resume methods

| Name | Description | | :--- | :--- | | playPause | Toggle the movement of the marquee to play or pause. | | stop | Stop the movement of the marquee. | | restart | Restart the movement of the marquee to the initial move point. |

API

input properties

@Input() direction

string Property sets the controlling direction of marquee movement.

default value: "left"

Note: The taskOnUpdateContent() callback function is not fired when direction value is "alternate".

possible values

  • "left"
  • "right"
  • "alternate"

Example

<ngx-marquee direction="right">
  <mark>My ticker text</mark>
</ngx-marquee>

@Input() duration

string Property sets the length of time that an animation takes to complete one cycle.

default value: "20s"

Note: The duration string format must be a value preceded by a letter s or ms to denote time in seconds or milliseconds respectively.

Example

<ngx-marquee duration="120s">
  <mark>My ticker text</mark>
</ngx-marquee>

@Input() pauseOnHover

boolean Property set to pause the marquee movement while hover user event.

default value: false

Example

<ngx-marquee pauseOnHover="true">
  <mark>My ticker text</mark>
</ngx-marquee>

@Input() animation

string Property sets animation entrance when the marquee cycle starts.

default value: "default"

Note: Only "default" animation is available when direction value is "alternate".

possible values

  • "default"
  • "slideInUp"
  • "slideInDown"

Example

<ngx-marquee animation="slideInUp">
  <mark>My ticker text</mark>
</ngx-marquee>

@Input() pendingUpdates

boolean Property indicates that taskOnUpdateContent callback function will be executed when the current movement cycle has been finished.

default value: false

Example

<ngx-marquee pendingUpdates="false">
  <mark>My ticker text</mark>
</ngx-marquee>

@Input() taskOnUpdateDuration

function Customized callback function to be used to determine the new duration value that an animation takes to complete the next cycle. This callback function will be executed if pendingUpdates property is set on true and the current cycle of marquee movement has been finished.

return: string

Note: If taskOnUpdateDuration( ) function is not supplied, the duration value is considered.

possible values

foo = (): string => {
  // Some imaginative lines about the new duration of your marquee
  // ...
  return "90ms";
};

Example

<ngx-marquee [taskOnUpdateDuration]="foo" pendingUpdates="true">
  <mark>My ticker text</mark>
</ngx-marquee>

@Input() taskOnUpdateContent

function Customized callback function to be used to set new content in the next cycle. This callback function will be executed while pendingUpdates property is set on true and the current cycle of marquee movement has been finished.

return: void

Note: If taskOnUpdateContent( ) function is not supplied, the marquee remains unchanged.

possible values

anotherFoo = (): void => {
  // Some imaginative lines about the new content of your marquee
  // ...
};

Example

<ngx-marquee [taskOnUpdateContent]="anotherFoo" pendingUpdates="true">
  <mark>My ticker text</mark>
</ngx-marquee>

output properties

@Output() pendingUpdatesChange

This event indicates that the taskOnUpdateDuration or taskOnUpdateContent callbacks functions have been executed.

return: EventEmitter<boolean>

Note: You can take advantage of two-way data binding pattern for update pendingUpdates value simultaneously between your component logic and the marquee.

Example

<ngx-marquee [(pendingUpdates)]="isPendingUpdate" [taskOnUpdateContent]="anotherFoo">
  <mark>My ticker text</mark>
</ngx-marquee>

@Output() playStateChange

This event indicates the current state movement of the marquee.

return: EventEmitter<MarqueeState>

possible values

  • Running
  • Paused
  • Stopped

Note: You can map these values to respective lowercase "running", "paused", or "stopped" string's value.

Example

<ngx-marquee (playStateChange)="listenerFoo($event)">
  <mark>My ticker text</mark>
</ngx-marquee>

methods

playPause( ): void

Toggle the movement of the marquee to play or pause.

Note: Sets and emit (by playStateChange event) the current MarqueeState to Running or Paused.

stop( ): void

Stop the movement of the marquee.

Note: Sets and emit (by playStateChange event) the current MarqueeState to Stopped. Also, set the marquee to the initial move point and set the value of pendingUpdates to false.

restart( ): void

Restart the movement of the marquee to the initial move point.

Note: Sets and emit (by playStateChange event) the current MarqueeState to Running.

Any contributions are appreciated

paypal

Inspired by https://github.com/shivarajnaidu/ng-marquee