summaryrefslogtreecommitdiffstats
path: root/apps/gallery/js/slideshow.js
blob: 88e89f39ff004427baa473a654e266c051c4c7c9 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
$(document).ready(function(){
        
	$.endSlideshow = function () {
		if($.supersized.vars.slideshow_interval){
			clearInterval($.supersized.vars.slideshow_interval);
		};

		$('#supersized-holder').remove();
		$('#slideshow-content').hide();
		$('#thumb-list').remove();
	}
        
	// add slideshow in holder div
	$('#slideshow input.start').click(function(){

		var images=[];
		$('#gallerycontent div a').each(function(i,a){
			images.push({image : a.href, title : a.title, thumb : a.children[0].src, url : 'javascript:$.endSlideshow()'});
		});

		if (images.length <= 0) {
			return;
		}

		$('body').append("<div id='supersized-holder'></div>");
		$('#supersized-loader').remove();
		$('#supersized').remove();
		$('#supersized-holder').append("<div id='supersized-loader'></div><ul id='supersized'></ul>");
		$('#supersized').show();
		$('#slideshow-content').show();


		jQuery(function($){

			$.supersized({

				// Functionality
				slide_interval      :   3000,		// Length between transitions
				transition          :   1, 		// 0-None, 1-Fade, 2-Slide Top, 3-Slide Right, 4-Slide Bottom, 5-Slide Left, 6-Carousel Right, 7-Carousel Left
				transition_speed    :   700,		// Speed of transition

				// Components							
				slide_links         :   'blank',	// Individual links for each slide (Options: false, 'num', 'name', 'blank')
				slides              :   images		// Slideshow Images
							    
			});
		});

	});

	//close slideshow on esc and remove holder
	$(document).keyup(function(e) {
		if (e.keyCode == 27) { // esc
			$.endSlideshow();
		}
	});

});