Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/keaukraine/bootstrap-fs-modal
- Owner: keaukraine
- License: mit
- Created: 2017-07-04T14:07:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-10T14:04:05.000Z (about 7 years ago)
- Last Synced: 2024-09-28T15:43:00.832Z (3 months ago)
- Topics: bootstrap, bootstrap-modal, bootstrap3, modal, responsive
- Language: HTML
- Homepage:
- Size: 68.4 KB
- Stars: 56
- Watchers: 3
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
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
...
```That's all you need. JS automatically tracks `show.bs.modal` events and duplicates all buttons to modal header, wiring `click` events to original buttons.
## Used Libraries
* Twitter Bootstrap used under the MIT License https://github.com/twbs/bootstrap/blob/master/LICENSE
* jQuery used under the MIT license https://jquery.org/license/## License
**The MIT License**
Copyright (c) 2017 Oleksandr Popov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.