2010-05-20 12 views

Répondre

0

Aucune de ces solutions n'a fonctionné, mais merci pour votre aide les gars. Je devais me salir les mains dans les js ... voici mon code piraté: lightbox.js

... 
    // once image is preloaded, resize image container 


      imgPreloader.onload = (function(){ 
       var scale = 600/imgPreloader.height; //modified 
       this.lightboxImage.src = this.imageArray[this.activeImage][0]; 
       this.resizeImageContainer((imgPreloader.width * scale), //modified imgPreloader.height); 
      }).bind(this); 
      imgPreloader.src = this.imageArray[this.activeImage][0]; 
     }, 

     // 
     // resizeImageContainer() 
     // 
     resizeImageContainer: function(imgWidth, imgHeight) { 

      // get current width and height 
      var widthCurrent = this.outerImageContainer.getWidth(); 
      var heightCurrent = this.outerImageContainer.getHeight(); 

      // get new width and height 

      var widthNew = (imgWidth + LightboxOptions.borderSize * 2); 
      var heightNew = (600 + LightboxOptions.borderSize * 2); //modified 
... 
+0

maintenant si je peux obtenir un prototype et Mootools pour travailler sur la même page I » d rire ... lol! – Mikey1980

+0

ne fonctionne pas dans IE8 – Jeroen

0

Avec cette déclaration vous le style img au sein #lightbox

Essayez de supprimer les img de sorte que vous ne le style #lightbox

ce travail?

#lightbox { width: auto; height: 600px;}

+0

pas de dés mon ami – Mikey1980

0

Si vous passez par le HTML, il crée, vous pouvez voir qu'il est enveloppé dans un div avec id="lightbox" et dans ce div avec un id="outerImageContainer". Ce dernier a un attribut de style avec la hauteur de l'image. Essayez de cibler cela. Vous pouvez l'écraser dans votre CSS ou en changer la hauteur après son chargement.

0
<html> 
<head> 
    <style type="text/css"> 
     #lightbox { border : solid 2px #000000; position:absolute; } 
     #lightbox img { width:auto; height: 600px;} 
    </style> 
</head> 
<body> 
    <div id="lightbox"> 
     <img src="Desert.jpg" alt="desert" /> 
    </div> 
</body> 
</html>