JSPM

jqmodals

2.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q14677F
  • License MIT

jQuery plugin for modal popups

Package Exports

  • jqmodals

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (jqmodals) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

jQmodals

jQuery plugin for modal popups

v 1.1.0 - ".popup" class now customizable

v 2.0.1 - "closeAll" method, new docs, some bugfixes

v 2.1.0 - wrapper styles automated

v 2.1.1 - css bugfix

Usage

Download plugin or install via npm (npm install jqmodals)

  • Insert your popups into wrapper, like this:
<div class="wrapper">
    <div><!-- content --></div>
    <div><!-- content --></div>
    <div><!-- content --></div>
</div>
  • Add .popup class to your popups

  • initialize it:

$('.wrapper').jQmodals();
  • Set your triggers
$('.open').on('mousedown', function(){
    modal.open.('#first');
)}

API

#Modal ##jQuery.fn.jQmodals jQuery-wrapper for Modal.

Params

  • [klass=".popup"] string - Items class

Example modal = $(elem).jQmodals() modal.open(target)

Members

##modal.addPopup(popup) Adds popup into list of available popups

Params

  • popup jQuery | string | HTMLElement - Popup which you intend to add into popups list

Returns: Modal ##modal.open(target, [ajax]) Opens popup.

Params

  • target jQuery | string | HTMLElement - Target popup
  • [ajax] function | Deferred | jqXHR - jqXHR or Deferred or function. Waits for resolve before close popup.

Returns: jQuery - Target popup ##modal.close([ajax]) Close current popup and (if exists) opens parent popup.

Params

  • [ajax] function | Deferred | jqXHR - jqXHR or Deferred or function. Waits for resolve before close popup.

Returns: Modal ##modal.closeAll([ajax]) Close all popups

Params

  • [ajax] function | Deferred | jqXHR - jqXHR or Deferred or function. Waits for resolve before close popup.

Returns: Modal

Events

###closepopup Fires after popup closed with current popup as target

this references to targeted popup

##TODO

  • .popup class optionsl
  • closeAll method
  • automate main wrapper styles