Agenda

Required plugin

This feature requires the plugin file css/styles/agenda.css

Markup

Background markup
  • 7 AM
  • 8 AM
  • 9 AM
  • 10 AM
  • 11 AM
  • 12 AM
  • 1 PM
  • 2 PM
  • 3 PM
  • 4 PM
  • 5 PM
  • 6 PM
  • 7 PM
  • 8 PM
<div class="agenda">

	<!-- Time markers -->
	<ul class="agenda-time">
		<li class="from-7 to-8"><span>7 AM</span></li>
		<li class="from-8 to-9"><span>8 AM</span></li>
		<li class="from-9 to-10"><span>9 AM</span></li>
		<li class="from-10 to-11"><span>10 AM</span></li>
		<li class="from-11 to-12"><span>11 AM</span></li>
		<li class="from-12 to-13"><span>12 AM</span></li>
		<li class="from-13 to-14"><span>1 PM</span></li>
		<li class="from-14 to-15"><span>2 PM</span></li>
		<li class="from-15 to-16"><span>3 PM</span></li>
		<li class="from-16 to-17"><span>4 PM</span></li>
		<li class="from-17 to-18"><span>5 PM</span></li>
		<li class="from-18 to-19"><span>6 PM</span></li>
		<li class="from-19 to-20"><span>7 PM</span></li>
		<li class="at-20"><span>8 PM</span></li>
	</ul>

	<!-- Events list -->
	<div class="agenda-events">

		<!-- Events go here -->

	</div>

</div>
Fluid height

Agenda markup is fluid in width but also in height: just set a height to resize it:

  • 7 AM
  • 9 AM
  • 11 AM
  • 1 PM
  • 3 PM
  • 5 PM
  • 7 PM

Some time lines markers (the span part) have been removed to preserve readability.

<div class="agenda" style="height:200px">

	...

</div>
Extra elements
  • 7 AM
  • 9 AM
  • 11 AM
  • 1 PM
  • 3 PM
  • 5 PM
  • 7 PM
Monday
03:23
<!-- The class with-header is required to use the header style -->
<div class="agenda with-header">

	<ul class="agenda-time">
		...
		<!-- Colored time line -->
		<li class="from-11 to-12"><span class="blue">11 AM</span></li>
		...
	</ul>

	<div class="agenda-header">
		<!-- Previous arrow -->
		<a href="#" title="Previous day" class="agenda-previous"><span class="icon-left-round"></span></a>

		<!-- Next arrow, disabled -->
		<a href="#" title="Next day" class="agenda-next disabled"><span class="icon-right-round"></span></a>

		<!-- Title -->
		Monday
	</div>

	<div class="agenda-events">

		<!-- Striped zone -->
		<div class="dark-stripes from-12 to-14"></div>

		<!-- Current time line -->
		<div class="agenda-now" style="top:63.75%"><span>03:23</span></div>

	</div>

</div>

Quick tip

If you use span for disabled previous/next arrows, they will look disabled too, no need to add the class disabled
Positioning events and time lines

The agenda style provides an easy way to set events and time lines positions, using a set of predefined classes:

Set start time

Use the classes from-7, from-7-30, from-8, from-8-30... and so on to from-20.

Set end time

Use the classes to-7, to-7-30, to-8, to-8-30... and so on to to-20.

Collapsed events

For ponctual elements (such as lines), use the classes at-7, at-7-30, at-8, at-8-30... and so on to at-20.

Out-of-range events

For events starting or ending out of the time range, use the classes from-before and to-after.

Change time range

The default time range goes from 7:00 to 20:00. To change this, edit the time positioning classes as follow:

  1. Get the number of hours in the desired range, for instance 7 -> 20 = 13
  2. Calculate the interval for each hour : 100/13 = 7.692
  3. Start at the first hour with top: 0
  4. Then increase top position for each hour by the calculated interval
  5. Half hours are set using adding half the interval

Do the same but in reverse for the to-* values, start from 100, then decrease.

Full-width events
  • 7 AM
  • 9 AM
  • 11 AM
  • 1 PM
  • 3 PM
  • 5 PM
  • 7 PM
Event description Event description
<!-- Event with link -->
<a href="#" class="agenda-event from-7 to-12">
	<time>7 AM - 12 AM</time>
	Event description
</a>

<!-- Static event, custom color -->
<span class="agenda-event from-15 to-20 anthracite-gradient">
	<time>3 PM - 8 PM</time>
	Event description
</span>
Side-by-side events
  • 7 AM
  • 9 AM
  • 11 AM
  • 1 PM
  • 3 PM
  • 5 PM
  • 7 PM
Event description Event description
<!-- Left event -->
<span class="agenda-event from-8 to-14-30 event-1-on-2">
	<time>8 AM - 2:30 AM</time>
	Event description
</span>

<!-- Right event -->
<span class="agenda-event from-12 to-19 event-2-on-2">
	<time>12 AM - 7 PM</time>
	Event description
</span>
  • 7 AM
  • 9 AM
  • 11 AM
  • 1 PM
  • 3 PM
  • 5 PM
  • 7 PM
Event description Event description Event description
<!-- Left event -->
<span class="agenda-event from-8 to-13-30 event-1-on-3">
	<time>8 AM - 1:30 PM</time>
	Event description
</span>

<!-- Middle event -->
<span class="agenda-event from-10-30 to-17-30 event-2-on-3">
	<time>10:30 AM - 5:30 PM</time>
	Event description
</span>

<!-- Right event -->
<span class="agenda-event from-14 to-19-30 event-3-on-3">
	<time>2 PM - 7:30 PM</time>
	Event description
</span>

Multi-columns agenda

The background markup for multi-columns agendas is the same, but with multiple agenda-events blocks in a agenda-wrapper wrapper:

Sunday
Event description
Monday
Event description Event description
03:23
Tuesday
Event description Priv Event description Event description
Wednesday
Event description Event description Event description
Thursday
Event description Event description Event description
Friday
Event description Event description
Saturday
<div class="agenda with-header">

	<!-- Time markers -->
	<ul class="agenda-time">
		...
	</ul>

	<!-- Columns wrapper -->
	<div class="agenda-wrapper">

		<!-- Events lists -->
		<div class="agenda-events agenda-day1">...</div>
		<div class="agenda-events agenda-day2">...</div>
		<div class="agenda-events agenda-day3">...</div>
		<div class="agenda-events agenda-day4">...</div>
		<div class="agenda-events agenda-day5">...</div>
		<div class="agenda-events agenda-day6">...</div>
		<div class="agenda-events agenda-day7">...</div>

	</div>

</div>

By default, the multi-column agenda has 7 columns, if you need a different number you may create a special class - for instance if you need 4 columns:

/* Special class to use 4 columns: .agenda-4-cols */
.agenda-4-cols > .agenda-day1	{	left: 0;	right: 75%;	}
.agenda-4-cols > .agenda-day2	{	left: 25%;	right: 50%;	}
.agenda-4-cols > .agenda-day3	{	left: 50%;	right: 25%;	}
.agenda-4-cols > .agenda-day4	{	left: 75%;	right: 0;	}

The just add this new class to the wrapper block, and you are done!

Auto-scrolling agenda

Required plugin

This feature requires the plugin file js/developr.agenda.js

Multi-columns agenda look good on wide screens, but are impossible to read on smaller screen. Therefore, the template includes an auto-scroll plugin, which will detect the available width and display the right number of columns to preserve readability. On smaller screens, there will be only one column visible at the time, for instance. The plugin also takes care of adding scroll arrows, and provides methods to scroll columns by code.

Here is an example: the agenda contains a full week, try resizing the window to see how the columns are hidden/shown by the plugin to match available space:

  • 7 AM
  • 8 AM
  • 9 AM
  • 10 AM
  • 11 AM
  • NOON
  • 1 PM
  • 2 PM
  • 3 PM
  • 4 PM
  • 5 PM
  • 6 PM
  • 7 PM
  • 8 PM
Sunday
Event description
Monday
Event description Event description
03:23
Tuesday
Event description Priv Event description Event description
Wednesday
Event description Event description Event description
Thursday
Event description Event description Event description
Friday
Event description Event description
Saturday

To use it, just add the class auto-scroll to your agenda:

<div class="agenda with-header auto-scroll">

	...

</div>

It is also possible to define manually the number of visible columns, whatever the available space. For instance, to show only one column:

  • 7 AM
  • 8 AM
  • 9 AM
  • 10 AM
  • 11 AM
  • NOON
  • 1 PM
  • 2 PM
  • 3 PM
  • 4 PM
  • 5 PM
  • 6 PM
  • 7 PM
  • 8 PM
Sunday
Event description
Monday
Event description Event description
03:23
Tuesday
Event description Priv Event description Event description
Wednesday
Event description Event description Event description
Thursday
Event description Event description Event description
Friday
Event description Event description
Saturday

This example uses some of the options detailled below:

<div class="agenda with-header auto-scroll" data-agenda-options='{"auto":false,"first":1}'>

	...

</div>

Quick tip

You may add agenda-previous and agenda-next arrows to first and last days by yourself, the plugin won't overwrite them, and you can use them for custom actions - for instance, load next week.

Methods

$(selector).scrollAgenda(options)

Enable agenda scrolling

Parameters

@param object options - optional (see defaults for a complete list)

$(selector).scrollAgendaFirstColumn(firstCol, animate)

Set the first visible column

Parameters

@param int|string|jQuery firstCol either an index (starting from 0), an CSS selector or a jQuery object
@param boolean|null animate true to animate the movement, false to disable animation, null to use settings value (optional, default: null)

$(selector).scrollAgendaToPrevious()

Scroll an agenda to previous column

$(selector).scrollAgendaToNext()

Scroll an agenda to next column

Options reference

The defaults may be modified at runtime in $.fn.scrollAgenda.defaults, and options may be passed inline using the data-agenda-options attribute
auto
Should the plugin automatically determine the number of visible columns?
Type: boolean
Default: true
columns
Number of visible columns if auto is false
Type: int
Default: 1
minWidth
Minimum columns width for auto detection
Type: int
Default: 200
animate
Animate column movement
Type: boolean
Default: true
first
First visible column - starts at 0 (only used at startup)
Type: int
Default: 0
prevTitle
Previous arrow title
Type: string
Default: 'Previous'
nextTitle
Next arrow title
Type: string
Default: 'Next'
onSizeChange
Callback fired each time the number of visible columns change (including at startup)
The function gets one parameter, the new number of visible columns
Type: function
Default: null
onRangeChange
Callback fired each time the visible range changes
The function gets 2 parameters: first and last visible columns' index (start at 0)
Type: function
Default: null