Ignore:
Timestamp:
Sep 16, 2012, 11:31:20 PM (12 years ago)
Author:
Zaphod
Message:

version 2.3.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/stripped/js/scripts-tpp.js

    r17407 r17961  
    160160        var img_ratio=image_w / image_h;
    161161
    162         if (options.imageAutosize) {
    163        
    164                 // Autosize image
     162        if ((options.imageAutosize) || (options.themeStyle != 'original')) {
     163       
    165164                jQuery(window).resize(function () {
    166165                       
     
    172171                        var Content=jQuery("#content");
    173172                       
    174                         var marge_cote;
    175 
     173                        var marge_cote=5;
     174                       
    176175                        var marge_sup = 5 + Content.offset().top;
    177176                        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                        }
    179184                        var marge_spec = 0;
    180185
     
    197202                        }
    198203                       
    199                         var Hmin = options.imageAutosizeMinHeight;
    200                        
    201204                        if (Image.length != 1) {
    202205                                if (TitleBox.length !=0) TitleBox.css("width","97%");
     
    204207                        }
    205208
     209                        var win_height = Fenetre.height();
    206210                        marge_inf = ImageContainer.height()-Image.height()+marge_inf;
    207                         var win_height = Fenetre.height();
    208211                        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                        }
    231243
    232244                        if (options.themeStyle != 'original') {
     
    252264                        TitleBox.css("opacity","1");
    253265
    254 
    255                         // limit img title Container width
    256 /*
    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                         // test
    268266                        if (options.themeStyle != 'original') {
    269267                                var max_footer_width = jQuery("#content").width() - jQuery("#tabTitles").width() - 5;
     
    281279                jQuery("#theImg").css("opacity","1");
    282280                jQuery("#imageTitleContainer").css("opacity","1");
     281                jQuery("#theImageAndTitle").css("position","static");
     282                jQuery("#theImageAndTitle").css("margin-top","10px");
    283283                var TitleBox=jQuery("#imageTitleContainer");
    284284                if (TitleBox.length !=0) TitleBox.css("width","97%");
    285                
    286285        }
    287286       
Note: See TracChangeset for help on using the changeset viewer.