Modal
Basic Structure
Modal component requires modal-toggle
, modal-backdrop
, and modal-content
like as below. You don't need to hide the
modal window by CSS, as Zerolines.js automatically hides it. modal-dismiss
is optional.
<button type="button" data-zl="modal-toggle target-[#modal1]">
Modal Open
</button>
<div id="modal1" data-zl="modal-backdrop" zl-cloak>
<div data-zl="modal-content move-down-md">
<!-- Content Here -->
<button data-zl="modal-dismiss">Cancel</button>
</div>
</div>
modal-toggle
Item | Description |
---|---|
target-[SELECTOR] *required |
Specify the target element to open. Put a CSS selector value between [ and ]. Double Quatation is not required. The target must be only one element. Example
|
modal-backdrop
modal-backdrop is the background of modal-content. modal-backdrop must
be a child(or descendant) or same element of the target element that is
specified by modal-toggle option. It's fade in/out with comfortable
speed(300ms) by default. If you put a fade speed option to modal-content
, this fading speed will be over written.
Item | Description |
---|---|
- |
- |
modal-content
modal-content must be a child(or descendant) element of the target element that is specified by modal-toggle option. Fade speed, move direction, and zooming are able to put in modal-content option. It's fade in/out with comfortable speed(300ms) by default.
move
and zoom
cannot be used at the same time.
Item | Description |
---|---|
Fade Speed |
|
quickly (optional) |
Fade in/out as quick speed.(100ms) Example
|
slowly (optional) |
Fade in/out as slow speed.(500ms) Example
|
no-animation (optional) |
No fading.(0ms) Example
|
Move Direction |
|
move-down-sm (optional) |
Move down when fading in, move up when fading out, with small moving distance. Example
|
move-down-md (optional) |
Move down when fading in, move up when fading out, with medium moving distance. Example
|
move-down-lg (optional) |
Move down when fading in, move up when fading out, with large moving distance. Example
|
move-up-sm (optional) |
Move up when fading in, move down when fading out, with small moving distance. Example
|
move-up-md (optional) |
Move up when fading in, move down when fading out, with medium moving distance. Example
|
move-up-lg (optional) |
Move up when fading in, move down when fading out, with large moving distance. Example
|
move-right-sm (optional) |
Move right when fading in, move left when fading out, with small moving distance. Example
|
move-right-md (optional) |
Move right when fading in, move left when fading out, with medium moving distance. Example
|
move-right-lg (optional) |
Move right when fading in, move left when fading out, with large moving distance. Example
|
move-left-sm (optional) |
Move left when fading in, move right when fading out, with small moving distance. Example
|
move-left-md (optional) |
Move left when fading in, move right when fading out, with medium moving distance. Example
|
move-left-lg (optional) |
Move left when fading in, move right when fading out, with large moving distance. Example
|
Zooming |
|
zoom-in-sm (optional) |
zoom-in when fading in, zoom-out when fading out, with small change. Example
|
zoom-in-md (optional) |
zoom-in when fading in, zoom-out when fading out, with medium change. Example
|
zoom-in-lg (optional) |
zoom-in when fading in, zoom-out when fading out, with large change. Example
|
zoom-out-sm (optional) |
zoom-out when fading in, zoom-in when fading out, with small change. Example
|
zoom-out-md (optional) |
zoom-out when fading in, zoom-in when fading out, with medium change. Example
|
zoom-out-lg (optional) |
zoom-out when fading in, zoom-in when fading out, with large change. Example
|
modal-dismiss
modal-dismiss closes the target element that specified by modal-toggle option.