2.1.1 • Published 9 years ago

jqmodals v2.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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
2.1.1

9 years ago

2.1.0

9 years ago

2.0.1

9 years ago