1 | jQuery.noConflict(); |
---|
2 | jQuery(document).ready( |
---|
3 | function (jQuery) { |
---|
4 | //=================================================================== |
---|
5 | |
---|
6 | |
---|
7 | jQuery(window).resize(function (event, ui) { |
---|
8 | if (typeof (event) == 'undefined') return; |
---|
9 | var Type_Img = ""; |
---|
10 | //====== détection du type d'images ====== |
---|
11 | var Image = jQuery("#theImage").find("embed"); |
---|
12 | if (Image.length > 0) { |
---|
13 | Type_Img = "embed"; |
---|
14 | } else if (jQuery("#pamoorama").length) { |
---|
15 | |
---|
16 | Type_Img = "pamoorama"; |
---|
17 | } else if (jQuery("#theImage").find("img").length > 0) { |
---|
18 | Type_Img = "img"; |
---|
19 | } else if (jQuery("img").length > 0) { |
---|
20 | Type_Img = "img_autre"; |
---|
21 | } else { |
---|
22 | return; |
---|
23 | } |
---|
24 | //================================================================= |
---|
25 | switch (Type_Img) { |
---|
26 | case "img": |
---|
27 | var Image = jQuery("#theImage").find("img"); |
---|
28 | var TheImg = jQuery(Image).get(0); |
---|
29 | break |
---|
30 | case "img_autre": |
---|
31 | var Image = jQuery("img"); |
---|
32 | var TheImg = jQuery(Image).get(0); |
---|
33 | break |
---|
34 | case "embed": |
---|
35 | var Image = jQuery("#theImage").find("embed"); |
---|
36 | var TheImg = jQuery(Image).get(0); |
---|
37 | img_height = TheImg.clientHeight; |
---|
38 | img_width = TheImg.clientWidth; |
---|
39 | break |
---|
40 | case "pamoorama": |
---|
41 | var Images = jQuery("#pamoorama"); |
---|
42 | var Image = jQuery(Images).get(0); |
---|
43 | |
---|
44 | var TheImg = jQuery("#pamoorama").get(0); |
---|
45 | if (!TheImg) return; |
---|
46 | break |
---|
47 | } |
---|
48 | |
---|
49 | //================================================================================== |
---|
50 | var sel0 = jQuery(TheImg).position(); |
---|
51 | if (!sel0) return; |
---|
52 | |
---|
53 | mini_width = parseInt(mini_width); |
---|
54 | mini_height = parseInt(mini_height); |
---|
55 | |
---|
56 | W0 = parseInt(img_width); |
---|
57 | if (W0 < mini_width) return; |
---|
58 | |
---|
59 | H0 = parseInt(img_height); |
---|
60 | if (H0 < parseInt(mini_height)) return; |
---|
61 | |
---|
62 | var rapport = (W0 / H0); |
---|
63 | //========================================================================== |
---|
64 | var Licence = jQuery("#theImage").find(".licencetag"); |
---|
65 | if (Licence.length > 0) { |
---|
66 | var lmt = jQuery(Licence.get(0)).height(); |
---|
67 | h_p = jQuery(Licence.get(0)).height(); |
---|
68 | jQuery(Licence.get(0)).css("position", "relative"); |
---|
69 | |
---|
70 | jQuery(Licence.get(0)).css("top", "0px"); |
---|
71 | |
---|
72 | } else { |
---|
73 | var lmt = 0; |
---|
74 | |
---|
75 | } |
---|
76 | //==== paragraphe supplèmentaire === |
---|
77 | if (jQuery("#theImage").find("p")) { |
---|
78 | h_p = 0; |
---|
79 | Pars = jQuery("#theImage").find("p"); |
---|
80 | |
---|
81 | for (var i = 0; i < Pars.length; i++) { |
---|
82 | P0 = Pars.get(i); |
---|
83 | h_p += parseInt(jQuery(P0).height()); |
---|
84 | if (P0.currentStyle.marginTop) |
---|
85 | if (P0.currentStyle.marginTop != "auto") h_p += parseInt(P0.currentStyle.marginTop); |
---|
86 | if (P0.currentStyle.marginBottom) |
---|
87 | if (P0.currentStyle.marginBottom != "auto") |
---|
88 | h_p += parseInt(P0.currentStyle.marginBottom); |
---|
89 | if (P0.currentStyle.PaddingTop) h_p += parseInt(P0.currentStyle.PaddingTop); |
---|
90 | if (parseInt(P0.currentStyle.PaddingBottom)) h_p += parseInt(P0.currentStyle.PaddingBottom); |
---|
91 | |
---|
92 | } |
---|
93 | |
---|
94 | // n_t = (p_p.top - Image_height) + h_p; |
---|
95 | |
---|
96 | lmt += h_p; |
---|
97 | jQuery("#theImage").css("paddingBottom", 0 + "px"); |
---|
98 | } |
---|
99 | |
---|
100 | //========================================================================== |
---|
101 | var winheight = jQuery(window).height(); |
---|
102 | var Image_height = (winheight - sel0.top) - parseInt(marge_basse) - lmt; |
---|
103 | var height_user = eval(user_status + "_height"); |
---|
104 | var width_user = eval(user_status + "_width"); |
---|
105 | //============================================================= |
---|
106 | var reg1 = new RegExp("%", "g"); |
---|
107 | if (height_user.match(reg1)) |
---|
108 | Image_height = Image_height * parseInt(height_user) / 100; |
---|
109 | else |
---|
110 | Image_height = parseInt(height_user); |
---|
111 | //============================================================= |
---|
112 | echelle_max = parseFloat(echelle_max, '3'); |
---|
113 | var echelle = parseFloat(Image_height / H0, 3); |
---|
114 | |
---|
115 | if (echelle > echelle_max) { |
---|
116 | echelle = echelle_max; |
---|
117 | Image_height = parseInt(H0 * echelle); |
---|
118 | } |
---|
119 | |
---|
120 | var Imgage_Width = parseInt(Image_height * rapport); |
---|
121 | jQuery("#theImage").width("100%"); |
---|
122 | jQuery("#theImage").height("auto"); |
---|
123 | |
---|
124 | |
---|
125 | |
---|
126 | if (Type_Img == "pamoorama") { |
---|
127 | h1 = jQuery("#pamoorama").height(); |
---|
128 | jQuery("#pamoorama").css("overflow", "hidden"); |
---|
129 | jQuery("#pamoorama").css(jQuery(window).width() + "px"); |
---|
130 | |
---|
131 | jQuery("#pamoorama_outter").css("height", Image_height + "px"); |
---|
132 | jQuery("#pamoorama_outter").css("width", jQuery(window).width() + "px"); |
---|
133 | /* |
---|
134 | jQuery(TheImg).css(Image_height + "px"); |
---|
135 | jQuery(TheImg).css(jQuery(window).width() + "px"); |
---|
136 | */ |
---|
137 | zoom = Image_height / img_height; |
---|
138 | |
---|
139 | jQuery("#pamoorama_inner").css("zoom", zoom); |
---|
140 | |
---|
141 | |
---|
142 | |
---|
143 | } else { |
---|
144 | jQuery(TheImg).height(Image_height + "px"); |
---|
145 | jQuery(TheImg).width(Imgage_Width + "px"); |
---|
146 | |
---|
147 | } |
---|
148 | |
---|
149 | |
---|
150 | try { |
---|
151 | // pour les themes Gally |
---|
152 | initializeImageMode('resize'); |
---|
153 | } catch (e) { } |
---|
154 | return; |
---|
155 | }); |
---|
156 | |
---|
157 | //=================================================================== |
---|
158 | jQuery(window).resize(); |
---|
159 | jQuery(window).resize(); |
---|
160 | |
---|
161 | }); |
---|
162 | |
---|
163 | //========================================================= |
---|
164 | |
---|