views:

23

answers:

1

jQuery apparently will re-size an image if the image is 2 big to fit into the lightbox properly.

( As seen here ).

This does not happen for me though because when I view a LARGE image it takes up the whole page and you have to scroll to see the image.

Is there something I am missing where I can set the MAX width and height of the images in the jquery files or CSS?

Thanks in advanced!

A: 

In principle, you shouldn't have this problem.

Try to see if you have these lines (1405 line and so on):

http://github.com/balupton/jquery-lightbox/blob/master/scripts/jquery.lightbox.js

 if ( this.auto_resize !== false )
{ // We want to auto resize
var maxWidth = Math.floor(wWidth*(4/5));
var maxHeight = Math.floor(wHeight*(4/5));
var resizeRatio;
while ( iWidth > maxWidth || iHeight > maxHeight )
{ // We need to resize
if ( iWidth > maxWidth )
{ // Resize width, then height proportionally
resizeRatio = maxWidth/iWidth;
iWidth = maxWidth;
iHeight = Math.floor(iHeight*resizeRatio);
}
if ( iHeight > maxHeight )
{ // Resize height, then width proportionally
resizeRatio = maxHeight/iHeight;
iHeight = maxHeight;
iWidth = Math.floor(iWidth*resizeRatio);
}
}
}

Here you have iWidth which is the image width and maxWidth which is the width of the screen.

If the iWidth is bigger, it equals to maxWidth.

It must work.

netadictos
But I would like the Image never to be displayed bigger then 600px X 600px
Etienne
You will have to refactor line 1400, change $(window).width(), for this measure, or better, so that you can use it in advance, add a property from 745 on, and check in line 1400 if this maxWidth you want to establish exists. There is no other way, except you resizing the images to this width.
netadictos
pls tell me if it was worthy for you
netadictos
I've looked all over for this code in my JS files and it does not exist....
Etienne
Strange, the js I link is the last version of jquery lightbox
netadictos