Download the PHP package tobento/css-modal without Composer
On this page you can find all versions of the php package tobento/css-modal. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tobento/css-modal
More information about tobento/css-modal
Files in tobento/css-modal
Package css-modal
Short Description A classic modal, in which you can include any content you want
License MIT
Homepage https://www.tobento.ch
Informations about the package css-modal
CSS Modals
The modals.css provides a classic modal, in which you can include any content you want. In addition, the modals.js provides logic to open and close modals.
Table of Contents
- Getting started
- Browser support
- Import Files
- Documentation
- Css
- Basic Usage
- Sizing
- Positions
- Animations
- Javascript
- Register
- Methods
- Events
- Css
- Credits
Getting started
Browser support
Modern browser only.
Import Files
Documentation
You may visit the docs.tobento.ch/css-modal page for documentation with demo.
Css
Basic Usage
The basic modal structure is:
The minimal modal structure is:
To activate the modal, just add the class on the container. The provided modal.js file implements the logic to open, close and animate the modals.
Sizing
By default, the modal has full width size. You may apply one of the following sizes:
- is of width
- is of width
- is of width
- is full width and height
- is full width and height on tablets and mobile
- is full width and height on mobile
You may combine the following sizes:
If you are using the basis.css - Sizing you may use it too.
Positions
By default, the modal is horizontal and vertical centered. You may combine the horizontal and vertical classes.
Modal Horizontal Alignment:
Modal Vertical Alignment:
Example bottom right aligned:
Example top centered aligned:
Animations
Available Animations:
Example:
Javascript
Register
The Html markup for registering a modal is:
You may add the class to any tag for closing the modal:
Options:
Option | Value | Description |
---|---|---|
, default | Disables scroll, keeping scrollbar hidden. | |
Disables scroll, keeping scrollbar visible. | ||
Without disable scroll. | ||
, default | The trigger classes to close the modal. |
Methods
You may import the modals module and use its methods:
Events
Event | Description |
---|---|
This event is fired before the modal is opened. | |
This event is fired after the modal is opened. | |
This event is fired before the modal is closed. | |
This event is fired after the modal is closed. |
Credits
- Tobias Strub
- All Contributors