NOTE: This repository is no longer maintained and has been archived. The project has been moved to a new repository: elections-carousel-component.
Parameters
The following carousel features can be (optionally) customized:
| Parameter | Type (Default value) |
Description |
|---|---|---|
| url | url (default value: http://127.0.0.1:8080/src/assets/fixtures/results.js) |
The URL for the (JSON) data feed |
| callback | string(default value: gNews_getRidingDetailsCallback) |
The JSON-P callback function name |
| headingtext | string(default value: 2011 Election Results) |
The text content of the <h1></h1> tags |
| slidewidth | int(default value: 600) |
The width (in px) of each riding 'slide' |
| templateid | string(default value: #viewTemplate) |
The template identifier (ie. within the template file - refer to templatepath) |
| templatepath | path (default value: http://127.0.0.1:8080/src/assets/templates/viewFull.mustache) |
The full (absolute) path to the Mustache template file |
| transitiontime | int(default value: 300) |
The time span (in milliseconds) for carousel slide movement/rotation |
Initialization:
No arguments:
If no arguments are provided when it is initialized, the module will run using its default values.
Example:
ElectionsCarousel.init({});
is equivalent to:
ElectionsCarousel.init({
url :'http://127.0.0.1:8080/src/assets/fixtures/results.js',
callback :'gNews_getRidingDetailsCallback',
headingtext : '2011 Election Results',
slidewidth : 600,
templateid : '#viewTemplate',
templatepath : 'http://127.0.0.1:8080/src/assets/templates/viewFull.mustache',
transitiontime : 300
});
Overriding a selected parameter's default value:
Example: Initialize the module with an explicit transitiontime value of 100 msec in order to override the default (of 300 msec) as follows:
ElectionsCarousel.init({transitiontime: 100});
(NOTE: Default values will be used for all other unspecified parameters.)