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

https://github.com/omaxel/fullmod

A tiny jQuery full-screen modal component.
https://github.com/omaxel/fullmod

jquery-plugin modal modal-plugin modal-windows

Last synced: 6 months ago
JSON representation

A tiny jQuery full-screen modal component.

Awesome Lists containing this project

README

          

# FullMod
FullMod is a tiny jQuery full-screen modal component.

[**DEMO**](https://omarmuscatello.github.io/FullMod/)

* [Dependencies](#dependencies)
* [Usage](#usage)
* [Events](#events)
* [Methods](#methods)
* [CSS classes](#css-classes)

## Dependencies
* [jQuery](https://jquery.com/)

## Usage
Inside your `head`, add the following code:

Before closing the `body` element, add the following code:




Add this HTML in your page:






This is my title



×





This is the content of the modal.





Then you can show the modal using:


var myFullMod = $('#myFullMod').fullmod();
myFullMod.show();


## Events
You can attach events passing them as options in the fullmod constructor.

$('#myFullMod').fullmod({
onShowing: function(params) {
console.log('showing');
}
});

You can access to the fullmod instance from all events using the `this` object.

**onShowing(params)** _(type: `function`, default value: `null`)_

Function executed when the modal is hidden and the `show` method is called. If return `false`, the modal will never show.
The `params` parameter is the one specified when the `show` method is called.

**onShown** _(type: `function`, default value: `null`)_

Function executed when the modal is completely shown after the `show` method is called.

**onHiding(params)** _(type: `function`, default value: `null`)_

Function executed when the modal is shown and the `hide` method is called. If return `false`, the modal will never hidden.
The `params` parameter is the one specified when the `hide` method is called.

**onHidden** _(type: `function`, default value: `null`)_

Function executed when the modal is completely hidden after the `hide` method is called.

## Methods

**show(params)**

Shows the modal unless the `onShowing` function call returns `false`. If the modal is already shown and the `show` method is called, nothing happens (the `onShowing` function won't be called).

The `params` parameter is the object to pass to the `onShowing` event.

**hide(params)**

Shows the modal unless the `onHiding` function call returns `false`. If the modal is already hidden and the `hide` method is called, nothing happens (the `onHiding` function won't be called).

The `params` parameter is the object to pass to the `onHiding` event.

## CSS classes

| Action | Description | Classes |
|-----------------------|-------------------------------------------------------------------------------------------------------------|-------------------|
| Page loaded. | The modal is hidden. | `fullmod-hidden` |
| `show` method called. | The modal is hidden. If the `onShowing` function is null or returns `false`, the animation will be started. | `fullmod-showing` |
| | Show animation completed. | `fullmod-shown` |
| `hide` method called. | The modal is shown. If the `onHiding` function is null or returns `false`, the animation will be started. | `fullmod-hiding` |
| | Hide animation completed. | `fullmod-hidden` |