news-ticker

0.2.0 • Public • Published

news-ticker

a small news-ticker scroll bar for browser

English | 简体中文

Syntax

const ntInst = new NewsTicker(options)
ntInst.add(textParam)

Parameters

options Object

options.el Element news ticker would display in this el

options.textArr(optional, default is []Array of String string to be shown in news ticker

options.speed(optional, default is 2Number speed of scrolling, in px

options.onLeave(optional) Function would trigger when some text scroll out of the screen

textParam Array of String or String push some string to the end of Queue

How to use

install

NPM or yarn add news-ticker

import

import NewsTicker from 'news-ticker'

use it

const nt = new NewsTicker({
  el: $('.line')
})
nt.add('hello world')

css

.line {
  background: #282828
}
.line div {
  color: #FFC324;
  line-height: 28px;
  height: 28px;
}

License

MIT

Dev

  1. install all the dev dependencies: yarn
  2. dev: yarn dev
  3. package: yarn build

contributing

  1. Fork this repo
  2. Create your feature branch: git checkout -b MY-NEW-FEATURE
  3. Commit your changes: git commit -am 'ADD SOME FEATURE'
  4. Push to the branch: git push origin MY-NEW-FEATURE
  5. Submit a pull request :D

Readme

Keywords

none

Package Sidebar

Install

npm i news-ticker

Weekly Downloads

1

Version

0.2.0

License

MIT

Unpacked Size

2.94 MB

Total Files

19

Last publish

Collaborators

  • gaoryrt