Jump to content

lightbox width / height problem


amrita

Recommended Posts

This is - if i am not mistaken - the code which decides the width and height of the image when opened with "lightbox" - i want to have a max width and height so i dont have to scale the fotos first..code:resizeImageContainer: function( imgWidth, imgHeight) { // get curren width and height this.widthCurrent = Element.getWidth('outerImageContainer'); this.heightCurrent = Element.getHeight('outerImageContainer'); // get new width and height var widthNew = (imgWidth + (borderSize * 2)); var heightNew = (imgHeight + (borderSize * 2)); // scalars based on change from old to new this.xScale = ( widthNew / this.widthCurrent) * 100; this.yScale = ( heightNew / this.heightCurrent) * 100; // calculate size difference between new and old image, and resize if necessary wDiff = this.widthCurrent - widthNew; hDiff = this.heightCurrent - heightNew; if(!( hDiff == 0)){ new Effect.Scale('outerImageContainer', this.yScale, {scaleX: false, duration: resizeDuration, queue: 'front'}); } if(!( wDiff == 0)){ new Effect.Scale('outerImageContainer', this.xScale, {scaleY: false, delay: resizeDuration, duration: resizeDuration}); } // if new and old image are same size and no scaling transition is necessary, // do a quick pause to prevent image flicker. if((hDiff == 0) && (wDiff == 0)){ if (navigator.appVersion.indexOf("MSIE")!=-1){ pause(250); } else { pause(100);} } Element.setHeight('prevLink', imgHeight); Element.setHeight('nextLink', imgHeight); Element.setWidth( 'imageDataContainer', widthNew); this.showImage(); }, - however i dont know javascript so i have no idea what to change - help anyone? :-)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...