scaron / prettyphoto

prettyPhoto is a jQuery based lightbox clone. Not only does it support images, it also add support for videos, flash, YouTube, iFrames. It’s a full blown media lightbox. The setup is easy and quick, plus the script is compatible in every major browser.
http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/
553 stars 281 forks source link

Outdated window width/height values upon window resize, particularly for maximize/minimize situation, resulting in off-centered modal-box position. #83

Open Glidias opened 12 years ago

Glidias commented 12 years ago

Somewhere on line 107:

$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){  _center_overlay(); _resize_overlay();   });

Should be;

$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){ _resize_overlay(); _center_overlay();  });

instead. _resize_overlay() should be called first to get the correct window dimensions prior to centering the overlay.