news-ticker
v0.2.0
Published
news ticker in your page!
Downloads
18
Readme
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 2
)
Number
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
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
- install all the dev dependencies:
yarn
- dev:
yarn dev
- package:
yarn build
contributing
- Fork this repo
- Create your feature branch:
git checkout -b MY-NEW-FEATURE
- Commit your changes:
git commit -am 'ADD SOME FEATURE'
- Push to the branch:
git push origin MY-NEW-FEATURE
- Submit a pull request :D