integration/js/main.js
changeset 3 b5b13ce6935f
parent 2 6e47ed0c413c
child 4 b00fdbef41d4
equal deleted inserted replaced
2:6e47ed0c413c 3:b5b13ce6935f
     1 $(function(){
     1 $(function(){
     2 	//CLUSTER
     2 //CLUSTER
     3 	var clusterWidth=0;
     3 	var clusterWidth=0;
     4 	$('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; });
     4 	$('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; });
     5 	$('.cluster').width( clusterWidth );
     5 	$('.cluster').width( clusterWidth );
     6 	var clusterVisibleWidth = $(".cluster-visible").width();
     6 	var clusterVisibleWidth = $(".cluster-visible").width();
     7 	var clusterVisibleLeft = 20;
     7 	var clusterVisibleLeft = 20;
    39 					$(".cluster").css({
    39 					$(".cluster").css({
    40 						"left":0
    40 						"left":0
    41 					});
    41 					});
    42 				}
    42 				}
    43 			}
    43 			}
    44 			
       
    45 		});
    44 		});
    46 	
    45 	
    47 
       
    48 		//DRAGGABLE
    46 		//DRAGGABLE
    49 		$(".cluster").draggable({ axis: "x",containment: ".cluster-containment"  });
    47 		$(".cluster").draggable({ axis: "x",containment: ".cluster-containment"  });
    50 	};
    48 	};
    51 	//WIDGET
    49 //WIDGET
       
    50 	//VOLET
    52 	//$("div.content-left div.widget-wrap div.widget div.widget-inner").hide();
    51 	//$("div.content-left div.widget-wrap div.widget div.widget-inner").hide();
    53 	$("div.content-left div.widget-wrap div.widget h3 a").bind("click",function(e){
    52 	$("div.content-left div.widget-wrap div.widget h3 a").bind("click",function(e){
    54 		e.preventDefault();
    53 		e.preventDefault();
    55 		var widgetInner = $(this).parents("h3").siblings("div.widget-inner");
    54 		var widgetInner = $(this).parents("h3").siblings("div.widget-inner");
    56 		widgetInner.stop();
    55 		widgetInner.stop();
    60 		}else{
    59 		}else{
    61 			widgetInner.slideDown();
    60 			widgetInner.slideDown();
    62 			$(this).addClass("open");
    61 			$(this).addClass("open");
    63 		}
    62 		}
    64 	});
    63 	});
    65 	//DOCUMENTAIRE
    64 	//AFFICHAGE
       
    65 	$('.widget.affichage li a').bind('click',function(e){
       
    66 		e.preventDefault();
       
    67 		if ($(this).hasClass("treemap") && !$(this).hasClass("active")) {
       
    68 			$('.widget.affichage li a.liste').removeClass("active");
       
    69 			$(this).addClass('active');
       
    70 		}else if($(this).hasClass("liste") && !$(this).hasClass("active")){
       
    71 			$('.widget.affichage li a.treemap').removeClass("active");
       
    72 			$(this).addClass('active');
       
    73 		}
       
    74 	});
       
    75 //VOLET DOCUMENTAIRE
    66 	$("div.dossier-documentaire").hide();
    76 	$("div.dossier-documentaire").hide();
    67 	$("div.header a.dossier-button").bind("click",function(e){
    77 	$("div.header a.dossier-button").bind("click",function(e){
    68 		e.preventDefault();
    78 		e.preventDefault();
    69 		$("div.dossier-documentaire").stop()
    79 		$("div.dossier-documentaire").stop()
    70 		if($("div.dossier-documentaire").is(":visible")){
    80 		if($("div.dossier-documentaire").is(":visible")){
    71 			$("div.dossier-documentaire").slideUp();
    81 			$("div.dossier-documentaire").slideUp();
    72 		}else{
    82 		}else{
    73 			$("div.dossier-documentaire").slideDown();
    83 			$("div.dossier-documentaire").slideDown();
    74 		}
    84 		}
    75 	});
    85 	});
    76 	//ARTICLES
    86 //ARTICLES
    77 	$(".article-visuel-wrap").each(function(){
    87 	$(".article-visuel-wrap").each(function(){
    78 		var contentHeight = $(this).parents(".article-content").height();
    88 		var contentHeight = $(this).parents(".article-content").height();
    79 
       
    80 		//$(this).height(contentHeight);
    89 		//$(this).height(contentHeight);
    81 	});
    90 	});
       
    91 //FRISE
       
    92 	//valeurs init du slider à définir
       
    93 	var valSlider1 = 75;
       
    94 	var valSlider2 = 500;
       
    95 	var widthFrise = $('.frise').width();
       
    96 	$( "#slider-range" ).slider({
       
    97 		range: true,
       
    98 		min: 0,
       
    99 		max: widthFrise,
       
   100 		values: [ valSlider1, valSlider2 ],
       
   101 		create: function(event, ui){
       
   102 			
       
   103 			$(".voile-left").width(valSlider1);
       
   104 			$(".voile-right").width(widthFrise-valSlider2); 
       
   105 		},
       
   106 		slide: function( event, ui ) {
    82 
   107 
    83 	
   108 			$(".voile-left").width(ui.values[ 0 ]);
    84 
   109 			$(".voile-right").width(widthFrise-ui.values[ 1 ]);
    85 });
   110 		}
       
   111 	});
       
   112 });//jQuery