summaryrefslogtreecommitdiff
path: root/slideshows/default/template/events.js
blob: e05b7cc50f71b007322f6b9be081faabdf28945c (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
26
$(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();
                }
        });
});