while (!fitting){
if((pp_containerWidth > windowWidth)){
imageWidth = (windowWidth - 200);
imageHeight = (height/width) * imageWidth;
}else if((pp_containerHeight > windowHeight)){
imageHeight = (windowHeight - 200);
imageWidth = (width/height) * imageHeight;
}else{
fitting = true;
};
pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
};
_getDimensions(imageWidth,imageHeight);
if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){
_fitToViewport(pp_containerWidth,pp_containerHeight)
};
while (!fitting){
if((pp_containerWidth > windowWidth)){
imageWidth = (windowWidth - 200);
imageHeight = (height/width) * imageWidth;
}else if((pp_containerHeight > windowHeight)){
imageHeight = (windowHeight - 200);
imageWidth = (width/height) * imageHeight;
}else{
fitting = true;
};
pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
_getDimensions(pp_containerWidth, pp_containerHeight);
};
if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){
_fitToViewport(pp_containerWidth,pp_containerHeight)
};
// Vladimir version - larger lightbox, some case still bad aspect ratio
while (!fitting){
if((pp_containerWidth > windowWidth)){
imageWidth = (windowWidth - (pp_containerWidth - imageWidth) - 100);
imageHeight = (imageWidth/width)*height;
}else if((pp_containerHeight > windowHeight)){
imageHeight = (windowHeight - (pp_containerHeight - imageHeight) - 50);
imageWidth = (imageHeight/height)*width;
}else{
fitting = true;
};
pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
};
_getDimensions(imageWidth,imageHeight);
if((pp_containerWidth > windowWidth) || (pp_containerHeight > windowHeight)){
_fitToViewport(pp_containerWidth,pp_containerHeight)
};while (!fitting){
if((pp_containerWidth > windowWidth)){
imageWidth = (windowWidth - (pp_containerWidth - imageWidth) - 100); \\ orig. -200
imageHeight = (height/width) * imageWidth;
}else if((pp_containerHeight > windowHeight)){
imageHeight = (windowHeight - (pp_containerHeight - imageHeight) - 50); \\ orig. -200
imageWidth = (width/height) * imageHeight;
}else{
fitting = true;
};
pp_containerHeight = imageHeight, pp_containerWidth = imageWidth;
_getDimensions(pp_containerWidth, pp_containerHeight);
};It looks like you're new here. If you want to get involved, click one of these buttons!