| author | Anthony Ly <anthonyly.com@gmail.com> |
| Tue, 09 Oct 2012 16:31:25 +0200 | |
| changeset 4 | b00fdbef41d4 |
| parent 3 | b5b13ce6935f |
| child 5 | 16413123bc8c |
| permissions | -rwxr-xr-x |
|
1
43d9dff6758a
premiers ajout front périples
Anthony Ly <anthonyly.com@gmail.com>
parents:
diff
changeset
|
1 |
$(function(){ |
| 3 | 2 |
//CLUSTER |
| 2 | 3 |
var clusterWidth=0; |
4 |
$('.cluster li').each( function(){ clusterWidth += $(this).width() + 10; }); |
|
5 |
$('.cluster').width( clusterWidth ); |
|
6 |
var clusterVisibleWidth = $(".cluster-visible").width(); |
|
7 |
var clusterVisibleLeft = 20; |
|
8 |
if (clusterWidth>clusterVisibleWidth) { |
|
9 |
$(".cluster-containment").css({ |
|
10 |
"left": -(clusterWidth-clusterVisibleWidth), |
|
11 |
"width":clusterWidth+(clusterWidth-clusterVisibleWidth+clusterVisibleLeft) |
|
12 |
}); |
|
13 |
$(".cluster-visible").css({"left": (clusterWidth-912+clusterVisibleLeft)}); |
|
14 |
$("a.cluster-arrow").bind("click",function(e){ |
|
15 |
console.log("click") |
|
16 |
e.preventDefault(); |
|
17 |
var clusterContainmentLeft = parseInt($(".cluster-containment").css("left")); |
|
18 |
var clusterContainmentRight = parseInt($(".cluster-containment").css("left")) + $(".cluster-containment").width(); |
|
19 |
var clusterLeft = parseInt($(".cluster").css("left")); |
|
20 |
var clusterRight = parseInt($(".cluster").css("left"))+$(".cluster").width(); |
|
21 |
if ($(this).hasClass("arrow-left")) { |
|
22 |
if (clusterLeft-40>clusterContainmentLeft) { |
|
23 |
$(".cluster").css({ |
|
24 |
"left":"-="+40 |
|
25 |
}); |
|
26 |
}else{ |
|
27 |
$(".cluster").css({ |
|
28 |
"left":clusterContainmentLeft |
|
29 |
}); |
|
30 |
} |
|
31 |
|
|
32 |
}else if($(this).hasClass("arrow-right")){ |
|
33 |
|
|
34 |
if (clusterRight+40<clusterContainmentRight) { |
|
35 |
$(".cluster").css({ |
|
36 |
"left":"+="+40 |
|
37 |
}); |
|
38 |
}else{ |
|
39 |
$(".cluster").css({ |
|
40 |
"left":0 |
|
41 |
}); |
|
42 |
} |
|
43 |
} |
|
44 |
}); |
|
45 |
|
|
46 |
//DRAGGABLE |
|
47 |
$(".cluster").draggable({ axis: "x",containment: ".cluster-containment" }); |
|
48 |
}; |
|
| 3 | 49 |
//WIDGET |
50 |
//VOLET |
|
|
4
b00fdbef41d4
ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents:
3
diff
changeset
|
51 |
//Tout fermer par défaut |
|
b00fdbef41d4
ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents:
3
diff
changeset
|
52 |
//$("div.content-left div.widget-wrap div.widget div.widget-inner").hide().removeClass("open"); |
|
b00fdbef41d4
ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents:
3
diff
changeset
|
53 |
//$("div.dossier-similaire div.widget div.widget-inner").hide().removeClass("open"); |
|
b00fdbef41d4
ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents:
3
diff
changeset
|
54 |
|
|
b00fdbef41d4
ajout du header sur pages articles
Anthony Ly <anthonyly.com@gmail.com>
parents:
3
diff
changeset
|
55 |
$("div.content-left div.widget-wrap div.widget h3 a, div.dossier-similaire div.widget h3 a").bind("click",function(e){ |
| 2 | 56 |
e.preventDefault(); |
57 |
var widgetInner = $(this).parents("h3").siblings("div.widget-inner"); |
|
58 |
widgetInner.stop(); |
|
59 |
if ($(this).hasClass("open")) { |
|
60 |
widgetInner.slideUp(); |
|
61 |
$(this).removeClass("open"); |
|
62 |
}else{ |
|
63 |
widgetInner.slideDown(); |
|
64 |
$(this).addClass("open"); |
|
65 |
} |
|
66 |
}); |
|
| 3 | 67 |
//AFFICHAGE |
68 |
$('.widget.affichage li a').bind('click',function(e){ |
|
69 |
e.preventDefault(); |
|
70 |
if ($(this).hasClass("treemap") && !$(this).hasClass("active")) { |
|
71 |
$('.widget.affichage li a.liste').removeClass("active"); |
|
72 |
$(this).addClass('active'); |
|
73 |
}else if($(this).hasClass("liste") && !$(this).hasClass("active")){ |
|
74 |
$('.widget.affichage li a.treemap').removeClass("active"); |
|
75 |
$(this).addClass('active'); |
|
76 |
} |
|
77 |
}); |
|
78 |
//VOLET DOCUMENTAIRE |
|
| 2 | 79 |
$("div.dossier-documentaire").hide(); |
80 |
$("div.header a.dossier-button").bind("click",function(e){ |
|
81 |
e.preventDefault(); |
|
82 |
$("div.dossier-documentaire").stop() |
|
83 |
if($("div.dossier-documentaire").is(":visible")){ |
|
84 |
$("div.dossier-documentaire").slideUp(); |
|
85 |
}else{ |
|
86 |
$("div.dossier-documentaire").slideDown(); |
|
87 |
} |
|
88 |
}); |
|
| 3 | 89 |
//ARTICLES |
| 2 | 90 |
$(".article-visuel-wrap").each(function(){ |
91 |
var contentHeight = $(this).parents(".article-content").height(); |
|
92 |
//$(this).height(contentHeight); |
|
93 |
}); |
|
| 3 | 94 |
//FRISE |
95 |
//valeurs init du slider à définir |
|
96 |
var valSlider1 = 75; |
|
97 |
var valSlider2 = 500; |
|
98 |
var widthFrise = $('.frise').width(); |
|
99 |
$( "#slider-range" ).slider({ |
|
100 |
range: true, |
|
101 |
min: 0, |
|
102 |
max: widthFrise, |
|
103 |
values: [ valSlider1, valSlider2 ], |
|
104 |
create: function(event, ui){ |
|
105 |
|
|
106 |
$(".voile-left").width(valSlider1); |
|
107 |
$(".voile-right").width(widthFrise-valSlider2); |
|
108 |
}, |
|
109 |
slide: function( event, ui ) { |
|
| 2 | 110 |
|
| 3 | 111 |
$(".voile-left").width(ui.values[ 0 ]); |
112 |
$(".voile-right").width(widthFrise-ui.values[ 1 ]); |
|
113 |
} |
|
114 |
}); |
|
115 |
});//jQuery |