zurb/reveal

modal positioning

Closed this issue · 3 comments

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.

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.

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.

Perfect solution with changing the js