Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recenter incorrect height and width with padding #38

Open
ultimate-tester opened this issue Oct 22, 2014 · 2 comments
Open

recenter incorrect height and width with padding #38

ultimate-tester opened this issue Oct 22, 2014 · 2 comments

Comments

@ultimate-tester
Copy link

Hello,

I just discovered that the recenter function uses the incorrect height and width (the ones used in css.height and css.width). If you have a padding or margin on the popupBox div, then the padding will be subtracted from the real size resulting in the box being the amount of left and right padding smaller in width and the amount of top and bottom padding smaller in height.

To fix this, please change the recenter function to the following:

if (_height >= $popup.outerHeight(true)){
css.height = $popup.outerHeight(true);
}
if(_width >= $popup.outerWidth(true)){
css.width = $popup.outerWidth(true);
}
height = $popup.outerHeight(true)
, width = $popup.outerWidth(true);

Thanks in advance!

@shedy2
Copy link

shedy2 commented Nov 14, 2014

thanks

@dinbror
Copy link
Owner

dinbror commented Jan 24, 2015

Hey ultimate-tester.
I'm not sure that's right. If you only load an image the current release works fine, see example 5b on my demo page: http://dinbror.dk/bpopup. But if I add text or other content there is a bug. I'll look into it, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants