Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/keaukraine/bootstrap-fs-modal

A simple way to improve Bootstrap modals UX on mobile phones.
https://github.com/keaukraine/bootstrap-fs-modal

bootstrap bootstrap-modal bootstrap3 modal responsive

Last synced: 3 months ago
JSON representation

A simple way to improve Bootstrap modals UX on mobile phones.

Awesome Lists containing this project

README

        

# Bootstrap Mobile FullScreen Modal
A simple way to improve UX of Bootstrap 3 modals on mobile phones.

***Note**: Bootstrap 4 version of this plugin is available here - https://github.com/keaukraine/bootstrap4-fs-modal*

Regular Bootstrap 3 modals (with a lot of content) on mobile devices can cause additional scrolling to get to the bottom buttons of modal.

Fullscreen modal provides more native user experience on mobile phones, here is side-by-side comparison of regular and fullscreen modals:

![Regular Bootstrap Modal on Phone](http://i.imgur.com/Calp2Rb.gif)
![Fullscreen Bootstrap Modal on Phone](http://i.imgur.com/uIWVS1Q.gif)

Fullscreen modal does not affect modals in large viewports, and applies these styles only on mobile devices.

Live demo page is here - https://keaukraine.github.io/bootstrap-fs-modal/

## How to Use

You can obtain plugin either from GitHub or from npm, package name is `bootstrap-fs-modal`.

First, include CSS and JS from `dist` folder:

```html

...

```

Then, you have to add CSS class `modal-fullscreen` to modals which you want to work full-screen.

Plugin can create either text or icon buttons.
For buttons to appear as icons, you will need to make a little modification of HTML. Plugin processes all buttons in footer except the ones with `data-dismiss="modal"` attribute (close button, which will be always added automatically), and adds them either as text or as icon button. Icon for button can be either Glyphicon of Font Awesome icon and is set by `data-glyphicon` or `data-faicon` attribute. If one of these attributes is set, it will add button with provided icon. If icon attribute is not set or empty, it will create text button instead. Plugin will try to apply short text by looking for short button text in `data-mobile-text` attribute and falling back to button text if attribute is not set.

Example:

```html