diff --git a/jquery.modal.js b/jquery.modal.js index 7e62a4d..f873030 100644 --- a/jquery.modal.js +++ b/jquery.modal.js @@ -74,7 +74,8 @@ } else { this.$elm = el; this.anchor = el; - this.$body.append(this.$elm); + remove = function(event, modal) { modal.elm.remove(); }; + this.$body.append(this.$elm).on($.modal.CLOSE, remove); this.open(); } };