| version 1.3, 2010/12/10 13:06:06 |
version 1.4, 2011/06/28 09:47:09 |
|
|
| keyToNext: 'n', // (string) (n = next) Letter to show the next image. |
keyToNext: 'n', // (string) (n = next) Letter to show the next image. |
| // Don´t alter these variables in any way |
// Don´t alter these variables in any way |
| imageArray: [], |
imageArray: [], |
| activeImage: 0 |
activeImage: 0, |
| |
maxWidth: 800, |
| |
maxHeight: 600 |
| },settings); |
},settings); |
| // Caching the jQuery object with all elements matched |
// Caching the jQuery object with all elements matched |
| var jQueryMatchedObj = this; // This, in this context, refer to jQuery object |
var jQueryMatchedObj = this; // This, in this context, refer to jQuery object |
|
|
| * @param integer intImageHeight The image´s height that will be showed |
* @param integer intImageHeight The image´s height that will be showed |
| */ |
*/ |
| function _resize_container_image_box(intImageWidth,intImageHeight) { |
function _resize_container_image_box(intImageWidth,intImageHeight) { |
| |
// zmenit rozmery ak presahuju maximalne povolene hodnoty |
| |
if((settings.maxWidth != null && settings.maxHeight != null) |
| |
&& (intImageWidth > settings.maxWidth || intImageHeight > settings.maxHeight)) |
| |
{ |
| |
var isWider = intImageWidth > intImageHeight; // na sirku alebo na vysku ? |
| |
var scale = isWider ? settings.maxWidth/intImageWidth : settings.maxHeight/intImageHeight; |
| |
intImageWidth = intImageWidth * scale; |
| |
intImageHeight = intImageHeight * scale; |
| |
} |
| |
$('#lightbox-image').height(intImageHeight); |
| |
$('#lightbox-image').width(intImageWidth); |
| |
|
| // Get current width and height |
// Get current width and height |
| var intCurrentWidth = $('#lightbox-container-image-box').width(); |
var intCurrentWidth = $('#lightbox-container-image-box').width(); |
| var intCurrentHeight = $('#lightbox-container-image-box').height(); |
var intCurrentHeight = $('#lightbox-container-image-box').height(); |