[SPIP Zone] r4204 - /_plugins_/thickbox/thickbox.js

Author: fil@rezo.net
Date: Mon Jul 24 15:09:11 2006
New Revision: 4204

Log:
correction du bug FF et retour sur la tentative [4178] (Cody Lindley)

Modified:
    _plugins_/thickbox/thickbox.js

Modified: _plugins_/thickbox/thickbox.js

--- _plugins_/thickbox/thickbox.js (original)
+++ _plugins_/thickbox/thickbox.js Mon Jul 24 15:09:11 2006
@@ -53,9 +53,11 @@
     
     if(urlType == '.jpg' || urlType == '.jpeg' || urlType == '.png' || urlType == '.gif'){//code to show images

- var imgPreloader = new Image();
+ imgPreloader = new Image();
       imgPreloader.onload = function(){
+
         imgPreloader.onload = null;
+
         // Resizing large images added by Christian Montoya
         var pagesize = getPageSize();
         var x = pagesize[0] - 150;
@@ -78,18 +80,17 @@
           }
         }
         // End Resizing
- $("#TB_ImageOff").html("<img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/>");
+
         TB_WIDTH = imageWidth + 30;
         TB_HEIGHT = imageHeight + 60;
- TB_position();
- }
-
- $("#TB_window").append("<a href='' id='TB_ImageOff'><img id='TB_Image' src='"+url+"' alt='"+caption+"'/></a>"
+ $("#TB_window").append("<a href='' id='TB_ImageOff'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>"
         + "<div id='TB_caption'>"+caption+"</div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton'>x</a></div>");
       $("#TB_closeWindowButton").click(TB_remove);
+ TB_position();
       $("#TB_load").remove();
       $("#TB_ImageOff").click(TB_remove);
       $("#TB_window").slideDown();
+ }

       imgPreloader.src = url;
     }