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

content appears off-center in some instances #33

Open
smabbott opened this issue Jan 13, 2012 · 1 comment
Open

content appears off-center in some instances #33

smabbott opened this issue Jan 13, 2012 · 1 comment

Comments

@smabbott
Copy link

I've encountered some instances where images appear off-center to the right. The left edge of the image sits in the center of the window. You can simulate the effect by setting the left margin of the div that contains the image to 0. This sometimes fixes itself once the image finishes loading and always fixes itself if you scroll the page (presumably when setSelfPosition() is called).

My shot-in-the-dark guess at what is happening is that the positioning of the div occurs before the image finishes loading and the width of the image might not yet be known. Is there a known way to get around this?

I've seen this in Chrome and Safari. Haven't tried other browsers.

Thanks.

@buckwilson
Copy link
Owner

Yeah you have to call lightbox_me after the image is done loading, otherwise it won't correct itself.

I may write in a fix to make it a little smarter – or at least make the CSS more robust so it doesn't have to calculate all the time.

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

2 participants