GithubHelp home page GithubHelp logo

jonchretien / tickit Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 8 KB

A basic ticker that uses CSS animations & vanilla JavaScript.

License: MIT License

CSS 9.45% JavaScript 90.55%
ticker css vanilla-javascript css-animations javascript

tickit's Introduction

tickit

A basic ticker that uses CSS animations & vanilla JavaScript. It supports vertical scrolling and runs either on an infinite timed loop or when the user clicks the container.

Install

Download

CSS

JavaScript

Markup

tickit works with a base element and an inner container. Child elements are dynamically added.

<div id="tickit" class="tickit">
  <div class="tickit-inner js-tickit-inner"></div>
</div>

JavaScript

/**
 * @param {Object} config - Tickit configuration values.
 * @param {array} config.data - The text to display.
 * @param {string} config.selector - The id for the container element.
 * @param {number} config.duration - The animation duration.
 * @param {number} config.initialPos - The initial offset position.
 * @param {string} config.behavior - The user interaction behavior.
 */
var config = {
  data: ['item 1', 'item 2', 'item 3'],
  selector: '#tickit',
  duration: 1000,
  initialPos: -15,
  behavior: 'scroll'
};

var ticker = Ticker(config).init();

Browser Support

Still need to test in IE, iOS, and Android, but otherwise most modern browsers

License

tickit is released under the MIT license.

To Do

  • Demos
  • Tests
  • Account for longest txt in arr (for box width)
  • Test in IE, iOS, and Android browsers
  • Minify files

tickit's People

Contributors

jonchretien avatar

Stargazers

Dashon 'DJ' Hawkins avatar

Watchers

Patrick LEFEVRE avatar James Cloos avatar

Forkers

masterlamp

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.