• Topic
  • Discussion
  • OATWikiWeb.OATDOCticker(Last) -- Owiki? , 2016-08-19 14:58:52 Edit owiki 2016-08-19 14:58:52

    ticker.js

    Ticker - slowly appearing and disappearing text.

    Objects

    OAT.Ticker(element, text, options)

    Creates Ticker. It will show text in element. Argument options is an object containing the following:

    • loop - an OAT.TickerData.LOOP_ constant (default OAT.TickerData.LOOP_NONE)
    • add - an OAT.TickerData.ADD_ constant (default OAT.TickerData.ADD_END)
    • clear - an OAT.TickerData.CLEAR_ constant (default OAT.TickerData.CLEAR_ALL)
    • timing - an OAT.TickerData.TIMING_ constant (default OAT.TickerData.TIMING_GLOBAL)
    • defDelay - delay in msec (default 3000)
    • pause - pause (in msec) when all text is drawn (default 1000)

    Methods

    .start()

    Starts ticking.

    .stop()

    Stops ticking.

    Constants

    OAT.TickerData.ADD_

    Where to add characters to ticker

    • OAT.TickerData.ADD_START - at the beginning
    • OAT.TickerData.ADD_END - at the end

    OAT.TickerData.CLEAR_

    How to remove characters

    • OAT.TickerData.CLEAR_ALL - all at once
    • OAT.TickerData.CLEAR_START - one-by-one from beginning
    • OAT.TickerData.CLEAR_END - one-by-one from end

    OAT.TickerData.TIMING_

    How delay is specified

    • OAT.TickerData.TIMING_PERCHAR - per character
    • OAT.TickerData.TIMING_GLOBAL - per string

    OAT.TickerData.LOOP_

    What looping to use

    • OAT.TickerData.LOOP_NONE - no loop
    • OAT.TickerData.LOOP_BACK - draw text, hide it, and stop
    • OAT.TickerData.LOOP_FULL - continuous loop

    Example

    var t = new OAT.Ticker(div, "Hello world!", 
                           {delay:30,timing:TickerData.TIMING_PERCHAR});
    t.start();
    

    Referenced by...