From 2b9c8aaefa38ded22efe3b3f4f8bd1eedf6ee6a5 Mon Sep 17 00:00:00 2001 From: Benjamin Kiessling Date: Mon, 16 Jan 2012 15:33:24 +0100 Subject: Update example slideshow to use jquery only --- slideshows/default/template/events.js | 51 ++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'slideshows/default/template/events.js') diff --git a/slideshows/default/template/events.js b/slideshows/default/template/events.js index 9d69547..e05b7cc 100644 --- a/slideshows/default/template/events.js +++ b/slideshows/default/template/events.js @@ -1,25 +1,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(); - } - }); -}); +$(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(); + } + }); +}); + -- cgit v1.2.1