buckwilson / Lightbox_me

An easy to use lightbox plugin for jQuery
http://buckwilson.me/lightboxme
Other
433 stars 93 forks source link

Overlay is not working properly on android and Iphone #52

Open canamo06 opened 11 years ago

canamo06 commented 11 years ago

See the bug on the image, this happens when Y8D_v49KwG6Q-DVxF0LwUFEve80NKvecHCP6y5gErQI copy the content of the popup is bigger that the screen and the page content

Fix:

    function setOverlayHeight() { 

            if ($(window).height() < $(document).height()) {
                $overlay.css({height: $(document).height() + 'px'});
                 $iframe.css({height: $(document).height() + 'px'}); 
            } else {
                var heightNotContent=$self.closest(".mediaLightBox").height() +$self.closest(".mediaLightBox").height()*0.2; 
                if ($(window).height() > heightNotContent)                  
                    $overlay.css({height: '100%'});
                else
                    $overlay.css({height: heightNotContent});
                if (ie6) {
                    $('html,body').css('height','100%');
                    $iframe.css('height', '100%');
                } // ie6 hack for height: 100%; TODO: handle this in IE7
            }
        }