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

modal positioning #10

Closed
penguinbroker opened this issue May 27, 2011 · 3 comments
Closed

modal positioning #10

penguinbroker opened this issue May 27, 2011 · 3 comments

Comments

@penguinbroker
Copy link

Great script by the way.

I've modified the code so I can use it programmatically and also so it's compatible with back button support (a la jquery.address). The modals works fine but when the modal are triggered by the back button the behavior is that each modal is positioned a set number of pixels (around 100) below the position of the previously displayed modal. I'm not sure what is going on.

Could you shed some light on how the modal positioning is set and how I can possibly tweak the positioning?

Thanks.

@mkelly12
Copy link

The modal has a base offset set in the stylesheet top: 100px. The plugin positions it there plus the scrollTop, to ensure it's in the correct place even if you scrolled down the page.

I would need to see your code, but my guess is that the modal is moving down the page on the close animation, and starting from that same position for the next open animation.

@penguinbroker
Copy link
Author

I ended up fixing the issue by changing line #49 from:

topMeasure  = parseInt(modal.css('top')),

       to

topMeasure  = 60,

This seemed to give me more consistent behavior. Thanks.

@switchfire
Copy link

Perfect solution with changing the js

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

No branches or pull requests

3 participants