Monday, March 19, 2012

jQuery timeline plugin configuration

There are several configuration parameters that you can use for jQuery timeline plugin.

For apply the plugin you should write the next code:

$(document).ready(function () {
    $("#timeline").timeline(settings);
}

Where the settings is a set of key/value pairs that configure the plugin. All settings instead of timelineDataUrl are optional.

timelineDataUrl
The string containing the URL to which the ajax request will be sent. The plugin expects to receive a json object (with the data about events) as a response from this URL.

eventDateFormat
Default: 'dd.MM.yyyy HH:mm'
The format string that determines how the plugin will show the dates for the events.

language
Default: 'en'
The language that will be used to show the months names. The plugin supports 'en' (English), 'ko' (Korean), 'ru' (Russian) by default, and can be extended to support any language.

showLegend
Default: false
The value determines will the plugin show the legend block or not.

legendHeader
Default: 'Legend'
The string that will be shown as header for the legend block.

legendBusyDescription
Default: 'Time is occupied'
The string that will be shown as a description for the event item in the legend block.

getTooltipHtml(event)
Default: function (event) { return event.name + '<br/>' + event.startDate + ' - ' + event.finishDate; }
The function that will be used to get the html code that will be shown in the event tooltip.

1 comment:

  1. Thank you so much for the timeline plugin. Do you have any demo for this plugin?

    ReplyDelete