bPopup is a lightweight jQuery modal popup plugin (only 1.34KB gzipped). It doesn't create or style your popup but provides you with all the logic like centering, modal overlay, events and more. It gives you a lot of opportunities to customize so it will fit your needs.
Horizontal centering works fine if there's no scrollbar. However, if there's a scrollbar, it won't center anymore because it seems that the scrollbar is not included when calculating the window size.
Screenshot:
Additional Note:
Works fine in mobile since it's scrollbar is not visible as the desktop browsers.
Horizontal centering works fine if there's no scrollbar. However, if there's a scrollbar, it won't center anymore because it seems that the scrollbar is not included when calculating the window size.
Screenshot:
Additional Note: Works fine in mobile since it's scrollbar is not visible as the desktop browsers.