angular-ticker

WebJar for angular-ticker

License

License

MIT
Categories

Categories

Angular User Interface Web Frameworks
GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

simple-angular-ticker
Last Version

Last Version

1.0.4
Release Date

Release Date

Type

Type

jar
Description

Description

angular-ticker
WebJar for angular-ticker
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ttbarnes/angular-ticker

Download simple-angular-ticker

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/simple-angular-ticker/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>simple-angular-ticker</artifactId>
    <version>1.0.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/simple-angular-ticker/
implementation 'org.webjars.bower:simple-angular-ticker:1.0.4'
// https://jarcasting.com/artifacts/org.webjars.bower/simple-angular-ticker/
implementation ("org.webjars.bower:simple-angular-ticker:1.0.4")
'org.webjars.bower:simple-angular-ticker:jar:1.0.4'
<dependency org="org.webjars.bower" name="simple-angular-ticker" rev="1.0.4">
  <artifact name="simple-angular-ticker" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='simple-angular-ticker', version='1.0.4')
)
libraryDependencies += "org.webjars.bower" % "simple-angular-ticker" % "1.0.4"
[org.webjars.bower/simple-angular-ticker "1.0.4"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.bower : angular jar [1.4.0,1.5)
org.webjars.bower : angular-route jar [1.4.5,1.5)

Project Modules

There are no modules declared in this project.

angular-ticker

Simple angular ticker. Demo

Bower version

Dependencies

Angular.

Usage

  1. bower install simple-angular-ticker --save

  2. Add the scripts and css:

<link rel="stylesheet" href="bower_components/simple-angular-ticker/release/ticker.css">

<script src="bower_components/simple-angular-ticker/release/ticker.js"></script>

  1. Add the simpleAngularTicker module as a dependancy to your app:

angular.module('myApp', [ 'simpleAngularTicker' ])

  1. Define your ticker items, eg:
$scope.myTickerItems = [
   {
     title: 'item 1',
     copy: 'amazing copy here'
   },
   {
     title: 'item 2',
     copy: 'wow, this is great'
   },
   {
     title: 'item 3',
     copy: 'hello angular'
   }
]
  1. Add the ticker to your template (item $index is optional):
<ul ticker>
  <li ng-repeat="item in myTickerItems" class="item-{{$index}}">
    {{item.title}} - {{item.copy}}
  </li>
</ul>
  1. (optional) Customise styles to get the design you desire. See styling notes below.

Options

timing (optional): accepts a string of numbers. This scrolls the items every X seconds. Regular JS milliseconds.

<ul ticker timing="2500">
  <li ng-repeat="item in myTickerItems">
    {{item.title}} - {{item.copy}}
  </li>
</ul>

Styling

angular-ticker styling is as minimal as possible. For simplicity, only desktop is catered for as a default.

Depending on your requirements and for responsive design in particular, you will more than likely need to adjust some styles, or simply only show the ticker for larger screen sizes. For example:

  • The ticker has a default fixed height value of 195px. Custom styles could be:
[ticker].active {
  height:250px;
}
  • Each ticker li has a height of 39px (this isn't specifically defined). The height of an li is used to begin the scrolling effect with a minus margin of the same value. You may want to change this for different breakpoints (mobile could have 2 lines of text for example). Custom styles could be:
[ticker] .minus-margin-top {
  margin-top:-60px;
}

@media (min-width:768px) {
  [ticker] .minus-margin-top {
    margin-top:-30px;
  }
}

Versions

Version
1.0.4