JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q22619F
  • License ISC

滚动吧,字幕君

Package Exports

  • roll_text

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (roll_text) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

功能:字幕滚动,可开始、停止、重置。支持文字内容与速度的改变。

当前版本:v0.0.6

usage

npm

npm i roll_text
const Roll = require('roll_text')
// or
import Roll from 'roll_text';

const options = {
  container: '#box', // 必填,选择器
  content: "hello it's a demo", // 选填,文字内容,container为后备内容
  width: 100, // 选填,容器宽度,默认100px
  speed: 1, // 选填,滚动速度 默认1 正常速度,2倍速、0.5倍速
}
const roller = new Roll(options)

roller.start() // 开始滚动
roller.stop() // 停止滚动
roller.reset() // 重置

// 若要改变

cdn

<script src="https://cdn.jsdelivr.net/npm/roll_text@0.0.6/lib/cdn-main.js"></script>
<script>
  const options = {
    container: '#box', // 必填,选择器
    content: "hello it's a demo", // 选填,文字内容,container为后备内容
    width: 100, // 选填,容器宽度,默认100px
    speed: 1, // 选填,滚动速度 默认1 正常速度,2倍速、0.5倍速
  }
  const roller = new Roll(options)
  
</script>