X-Git-Url: http://git.cyclocoop.org/%27.parametre_url%28generer_action_auteur%28%27charger_plugin%27%2C%20%27supprimer_flux%27%29%2C%27supprimer_flux%27%2C%20%24url%29.%27?a=blobdiff_plain;f=www%2Fplugins-dist%2Fmediabox%2Fjavascript%2Fjquery.colorbox.js;h=d588171de5759f177ec78af33d314fd3f24a652f;hb=83e62ea97fafb78dde1372b78c1be4c71b5b1b58;hp=8bb51511e2565710eb33dede601b4216a4c5913f;hpb=a33c2ba9d919664b3bb0f565f8e9a8b9d8530cdb;p=lhc%2Fweb%2Fclavette_www.git diff --git a/www/plugins-dist/mediabox/javascript/jquery.colorbox.js b/www/plugins-dist/mediabox/javascript/jquery.colorbox.js index 8bb5151..d588171 100644 --- a/www/plugins-dist/mediabox/javascript/jquery.colorbox.js +++ b/www/plugins-dist/mediabox/javascript/jquery.colorbox.js @@ -258,9 +258,10 @@ } } + var init_dimensions = false; function launch(target) { if (!closing) { - + element = target; makeSettings(); @@ -290,6 +291,18 @@ } if (!open) { + if (!init_dimensions) { + init_dimensions = true; + // Cache values needed for size calculations + interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6 + interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); + loadedHeight = $loaded.outerHeight(true); + loadedWidth = $loaded.outerWidth(true); + + // Setting padding to remove the need to do size conversions during the animation step. + $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth}); + } + open = active = true; // Prevents the page-change action from queuing up if the visitor holds down the left or right keys. $box.show(); @@ -378,15 +391,6 @@ if (!init) { init = true; - // Cache values needed for size calculations - interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height();//Subtraction needed for IE6 - interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); - loadedHeight = $loaded.outerHeight(true); - loadedWidth = $loaded.outerWidth(true); - - // Setting padding to remove the need to do size conversions during the animation step. - $box.css({"padding-bottom": interfaceHeight, "padding-right": interfaceWidth}); - // Anonymous functions here keep the public method from being cached, thereby allowing them to be redefined on the fly. $next.click(function () { publicMethod.next();