Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1420 | Rev 1423 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1420 Rev 1422
1
$(document).ready(function() {	
1
$(document).ready(function() {	
2
	// Activation du carousel d'images
2
	// Activation du carousel d'images
3
	$('#smartflore-illustrations-galerie-carousel').carousel();
3
	$('#smartflore-illustrations-galerie-carousel').carousel();
4
	
4
	
5
	// Pour que les sources s'affichent dans une nouvelle fenêtre
5
	// Pour que les sources s'affichent dans une nouvelle fenêtre
6
	$('#smartflore-footer-button-sources').click(function() {
6
	$('#smartflore-footer-button-sources').click(function() {
7
		voirSources();
7
		voirSources();
8
	});
8
	});
-
 
9
	
-
 
10
	if(!!window.innerWidth) {
-
 
11
		var largeurFenetre = window.innerWidth;	
-
 
12
		// Tablettes / écran moyens, On met du L
-
 
13
		if(largeurFenetre > 500 && largeurFenetre < 1000) {
-
 
14
				adapterTailleImages('L');		
-
 
15
		} else {
-
 
16
			// Plus de 1000 px, XL est bien plus agréable			
-
 
17
			if(largeurFenetre >= 1000) {
-
 
18
				adapterTailleImages('XL');
-
 
19
			}
-
 
20
		}
-
 
21
	}
9
	
22
	
10
	function voirSources() {
23
	function voirSources() {
11
		var w = window.open();
24
		var w = window.open();
12
		var html = $("#smartflore-sources").html();
25
		var html = $("#smartflore-sources").html();
13
	
-
 
14
	    $(w.document.body).html(html);
26
	    $(w.document.body).html(html);
15
	}
27
	}
-
 
28
	
-
 
29
	function adapterTailleImages(taille) {
-
 
30
		$('#smartflore-illustrations-galerie-carousel img').each(function(index) {
-
 
31
			var src = $(this).attr('src');
-
 
32
			$(this).attr('src', src.replace('S', taille));
-
 
33
		});
-
 
34
	}
16
});
35
});
17
36