Changeset 17961 for extensions/stripped/js/scripts-tpp.js
- Timestamp:
- Sep 16, 2012, 11:31:20 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/stripped/js/scripts-tpp.js
r17407 r17961 160 160 var img_ratio=image_w / image_h; 161 161 162 if (options.imageAutosize) { 163 164 // Autosize image 162 if ((options.imageAutosize) || (options.themeStyle != 'original')) { 163 165 164 jQuery(window).resize(function () { 166 165 … … 172 171 var Content=jQuery("#content"); 173 172 174 var marge_cote ;175 173 var marge_cote=5; 174 176 175 var marge_sup = 5 + Content.offset().top; 177 176 var marge_inf; 178 if (options.themeStyle == 'original') { marge_inf = options.imageAutosizeMargin+10;} else { marge_inf = 30;}; 177 if (options.themeStyle == 'original') { 178 marge_inf = options.imageAutosizeMargin+10; 179 if (options.navArrows) marge_cote=20; 180 } else { 181 marge_inf = 30; 182 if (options.navArrows) marge_cote=25; 183 } 179 184 var marge_spec = 0; 180 185 … … 197 202 } 198 203 199 var Hmin = options.imageAutosizeMinHeight;200 201 204 if (Image.length != 1) { 202 205 if (TitleBox.length !=0) TitleBox.css("width","97%"); … … 204 207 } 205 208 209 var win_height = Fenetre.height(); 206 210 marge_inf = ImageContainer.height()-Image.height()+marge_inf; 207 var win_height = Fenetre.height();208 211 var img_H = win_height - marge_sup - marge_inf; 209 var max_H = img_H; 210 211 212 if (img_H >= image_h) img_H = image_h; 213 if (img_H <= Hmin) img_H = Hmin; 214 215 var img_W = Math.round(parseFloat(img_H * img_ratio)); 216 217 218 var marge_image = ImageCadre.outerWidth() - Image.width(); 219 var ext_width; 220 221 if (options.themeStyle == 'original') { ext_width = jQuery("#content").width();} else {ext_width = Fenetre.width();}; 222 var max_W = ext_width - marge_image - marge_cote * 2; 223 224 if (img_W > max_W) { 225 img_H = Math.round(parseFloat(max_W / img_ratio)); 226 img_W = max_W; 227 } 228 229 Image.css("width", img_W + "px"); 230 Image.css("height", img_H + "px"); 212 213 if (options.imageAutosize) { 214 215 var Hmin = options.imageAutosizeMinHeight; 216 217 var max_H = img_H; 218 219 if (img_H >= image_h) img_H = image_h; 220 if (img_H <= Hmin) img_H = Hmin; 221 222 var img_W = Math.round(parseFloat(img_H * img_ratio)); 223 224 var marge_image = ImageCadre.outerWidth() - Image.width(); 225 var ext_width; 226 227 if (options.themeStyle == 'original') { ext_width = jQuery("#content").width();} else {ext_width = Fenetre.width();}; 228 var max_W = ext_width - marge_image - marge_cote * 2; 229 230 if (img_W > max_W) { 231 img_H = Math.round(parseFloat(max_W / img_ratio)); 232 img_W = max_W; 233 } 234 235 Image.css("width", img_W + "px"); 236 Image.css("height", img_H + "px"); 237 238 } else { 239 240 img_H = image_h; 241 242 } 231 243 232 244 if (options.themeStyle != 'original') { … … 252 264 TitleBox.css("opacity","1"); 253 265 254 255 // limit img title Container width256 /*257 if (TitleBox.length != 0) {258 var TBminW = jQuery("#theImg").outerWidth();259 TitleBox.css("min-width",TBminW + "px");260 if (TitleBox.width() > TBminW) {261 TitleBox.children().css("text-align","justify");262 } else {263 TitleBox.children().css("text-align","center");264 }265 }266 */267 // test268 266 if (options.themeStyle != 'original') { 269 267 var max_footer_width = jQuery("#content").width() - jQuery("#tabTitles").width() - 5; … … 281 279 jQuery("#theImg").css("opacity","1"); 282 280 jQuery("#imageTitleContainer").css("opacity","1"); 281 jQuery("#theImageAndTitle").css("position","static"); 282 jQuery("#theImageAndTitle").css("margin-top","10px"); 283 283 var TitleBox=jQuery("#imageTitleContainer"); 284 284 if (TitleBox.length !=0) TitleBox.css("width","97%"); 285 286 285 } 287 286
Note: See TracChangeset
for help on using the changeset viewer.