Jump to content
  • 0

Lightbox. Как изменить максимальную высоту?


Alfa2015
 Share

Question

Для увеличения фоток используется Lightbox. 

Проблема возникла с высокими изображениями. То есть, изображение больше высоты экрана. И поэтому при "высоком" изображении не работает кнопка "CLOSE" http://savepic.su/4934392.png
Если изображ. уменьшить по высоте, то кнопка "CLOSE" начинает работать.

Что нужно сделать, чтобы кнопка работала при любой высоте? 

 

Я, как поняла за размер изображений отвечает этот код в файле lightbox.js:

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 = (imgHeight + LightboxOptions.borderSize * 2);        // scalars based on change from old to new        var xScale = (widthNew  / widthCurrent)  * 100;        var yScale = (heightNew / heightCurrent) * 100;        // calculate size difference between new and old image, and resize if necessary        var wDiff = widthCurrent - widthNew;        var hDiff = heightCurrent - heightNew;        if (hDiff != 0) new Effect.Scale(this.outerImageContainer, yScale, {scaleX: false, duration: this.resizeDuration, queue: 'front'});         if (wDiff != 0) new Effect.Scale(this.outerImageContainer, xScale, {scaleY: false, duration: this.resizeDuration, delay: this.resizeDuration});         // if new and old image are same size and no scaling transition is necessary,         // do a quick pause to prevent image flicker.        var timeout = 0;        if ((hDiff == 0) && (wDiff == 0)){            timeout = 100;            if (Prototype.Browser.IE) timeout = 250;           }        (function(){            this.prevLink.setStyle({ height: imgHeight + 'px' });            this.nextLink.setStyle({ height: imgHeight + 'px' });            this.imageDataContainer.setStyle({ width: widthNew + 'px' });            this.showImage();        }).bind(this).delay(timeout / 1000);    },
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy