Socket
Socket
Sign inDemoInstall

modaly

Package Overview
Dependencies
1
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    modaly

Modaly - A Tiny Modal


Version published
Weekly downloads
63
increased by28.57%
Maintainers
1
Install size
1.41 MB
Created
Weekly downloads
 

Changelog

Source

0.6.0

News

  • Added modaly:opened and modaly:closed callbacks.

Readme

Source

Modaly - A Tiny Modal

Build Status NPM Version Dependency Dev Dependency Code Climate Patreon

Modaly is a jquery plugin that generates a tiny modal window.

Required Files

  • jquery.modaly.css
  • jquery.modaly.js

Options

attribute:    'href'           // Changes the anchor's attribute.
block:        false            // Prevents the modal to open.
closeButton:  true             // Show the close button.
closeOverlay: true             // Enable close modal clicking on overlay.
closeTarget:  '.modaly__close' // Hook of the close button.
esc:          true             // Enable the key esc to close the modal.
overlay:      .5               // Overlay applied on overlay.
prevent:      true             // Prevent the click action on binded element.
speed:        200              // Speed to open and close the modal.
top:          undefined        // Distance between top of window and the modal.
visible:      false            // Keeps the modal visible on screen.

Usage

<div id="modal">
  <span class="modaly__close">x</span>
</div>
<a href="#modal">open</a>
$('a').modaly();

Callbacks

Callbacks are triggered over the modal element.

'modaly:opened': triggered when modaly is opened.
'modaly:closed': triggered when modaly is closed.

Functions

$('a').modaly('open');                   // Open the modal.

$('a').modaly('open', { key: 'value' }); // Open and add params at modal.

$('a').modaly('close');                  // Close the modal.

$('a').modaly('close', ['key']);         // Close and removes keys data from modal.

$('a').modaly('block', boolean);         // Block or unblock the modal.

Keywords

FAQs

Last updated on 09 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc