summaryrefslogtreecommitdiff
path: root/slideshows/default/template/events.js
blob: 9d69547ee9750c2273b825d86ec1949681ed4721 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$(document).ready(function(){

	var tot=$('.event').length;
	
	var screenWidth = $('.events').width();

	var bord = $('.event').outerWidth() - $('.event').innerWidth();
	var padd = $('.event').innerWidth() - $('.event').width();
	var marg = $('.event').outerWidth(true) - $('.event').outerWidth();
	$('.event').width((screenWidth-(tot * (bord+padd+marg)))/tot);

	$('.eventDate').each(function(index, value) {
		var colours = ['blue', 'green', 'chreme'];
		$(this).addClass(colours[index % 3]);
	});

	$('.eventField').each(function(index, value) {
		var classStr = $(this).attr('class').split(/\s+/);
		if(classStr.indexOf('start') != -1) {
			$(this).show();
		} else if(classStr.indexOf('summary') != -1) {
			$(this).show();
		}
	});
});