Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Prepares image exibition; doing a image´s preloader to calculate it´s size
- *
- */
- function _set_image_to_view() { // show the loading
- // Show the loading
- $('#lightbox-loading').show();
- if ( settings.fixedNavigation ) {
- $('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
- } else {
- // Hide some elements
- $('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
- }
- // Image preload process
- var objImagePreloader = new Image();
- objImagePreloader.onload = function() {
- $('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
- // Perfomance an effect in the image container resizing it
- width = objImagePreloader.width;
- height = objImagePreloader.height;
- width = (width > 1000) ? 1000 : width;
- height = (width == 1000) ? (1000/objImagePreloader.width)*height : height;
- $('#lightbox-image').attr("height", height);
- $('#lightbox-image').attr("width", width);
- _resize_container_image_box(width, height);
- // clear onLoad, IE behaves irratically with animated gifs otherwise
- objImagePreloader.onload=function(){};
- };
- objImagePreloader.src = settings.imageArray[settings.activeImage][0];
- };
Add Comment
Please, Sign In to add comment