GithubHelp home page GithubHelp logo

geoclaps / jquery-ticker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from benjaminrh/jquery-ticker

0.0 1.0 0.0 258 KB

A lightweight jQuery plugin for animating a simple news ticker

Home Page: https://benjaminrh.github.io/jquery-ticker/

License: MIT License

JavaScript 100.00%

jquery-ticker's Introduction

jquery-ticker

A lightweight jQuery plugin for animating a simple news ticker

Installation

Include script after the jQuery library:

<script src="/path/to/jquery.ticker.js"></script>

Usage

Add an HTML tag for the ticker container (like a div or a span) with one unordered list containing the ticker items inside. Other content may be inside the ticker container as well.

Ticker headlines (the li tags) may contain the following basic HTML tags: <a>, <b>, <strong>, <i>, <em>, <u>, and <span>.

<div class="ticker">
  <strong>News:</strong>
  <ul>
    <li>Ticker item #1</li>
    <li>Ticker item #2</li>
    <li><em>Another</em> ticker item</li>
    ...
  </ul>
</div>

And initiate it

$('.ticker').ticker();

You can even add some styling

.ticker {
  width: 500px;
  margin: 10px auto;
}
 /* The HTML list gets replaced with a single div,
    which contains the active ticker item, so you
    can easily style that as well */
.ticker div {
  display: inline-block;
  word-wrap: break-word;
}

Ticker Options

Ticker attributes can be set globally by setting properties of the $.ticker.defaults object or individually for each call to ticker() by passing a plain object to the options argument. Per-call options override the default options.

$.fn.ticker.defaults = {
  random:        false, // Whether to display ticker items in a random order
  itemSpeed:     3000,  // The pause on each ticker item before being replaced
  cursorSpeed:   50,    // Speed at which the characters are typed
  pauseOnHover:  true,  // Whether to pause when the mouse hovers over the ticker
  finishOnHover: true,  // Whether or not to complete the ticker item instantly when moused over
  cursorOne:     '_',   // The symbol for the first part of the cursor
  cursorTwo:     '-',   // The symbol for the second part of the cursor
  fade:          true,  // Whether to fade between ticker items or not
  fadeInSpeed:   600,   // Speed of the fade-in animation
  fadeOutSpeed:  300    // Speed of the fade-out animation
};

Authors

Benjamin Harris

jquery-ticker's People

Contributors

benjaminrh avatar

Watchers

 avatar

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.