Skip to content

Commit

Permalink
Should fix #34 (Multiple Modals) without breaking anything...
Browse files Browse the repository at this point in the history
  • Loading branch information
kylefox committed Jan 26, 2013
1 parent 810f8d7 commit 84b9e74
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 10 deletions.
23 changes: 22 additions & 1 deletion examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,28 @@ <h2>Example 5: the un-closable window</h2>
<div id="ex5" class="modal">
<p>If you do this, be sure to provide the user with an alternate method of <a href="#" rel="modal:close">closing the window.</a></p>
</div>


<hr />

<h2>Example 6: Multiple Modals</h2>

<p>There can only be one modal open at a time. If you open a new modal while an existing modal is open, the existing modal is closed first. If you need to manage state (ie: for step by step wizards) you'll need to do that yourself.</p>

<h3><a href="#ex6-1" rel="modal:open">Open First Modal</a></h3>

<div class="modal" id="ex6-1" style="display:none;">
<p>I'm the first modal. <a href="#ex6-2" rel="modal:open">Open second modal...</a></p>
</div>

<div class="modal" id="ex6-2" style="display:none;">
<p>I'm the second modal. <a href="#ex6-3" rel="modal:open">Open third modal...</a></p>
</div>

<div class="modal" id="ex6-3" style="display:none;">
<p>I'm the third modal. You get the idea.</p>
</div>


<script type="text/javascript" charset="utf-8">
$(function() {

Expand Down
3 changes: 2 additions & 1 deletion jquery.modal.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*
A simple jQuery modal (http:https://github.com/kylefox/jquery-modal)
Version 0.5.1
Version 0.5.2
*/
(function($) {

var current = null;

$.modal = function(el, options) {
$.modal.close(); // Close any open modals.
var remove, target;
this.$body = $('body');
this.options = $.extend({}, $.modal.defaults, options);
Expand Down
10 changes: 2 additions & 8 deletions jquery.modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 84b9e74

Please sign in to comment.