Skip to content

Commit 48b20e4

Browse files
committed
Avoid having to set inline styles to hide modal by default. Fix issue kylefox#186
1 parent a9b77a9 commit 48b20e4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

jquery.modal.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
background-color: transparent;
2222
}
2323
.modal {
24-
display: inline-block;
24+
display: none;
2525
vertical-align: middle;
2626
position: relative;
2727
z-index: 2;

jquery.modal.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
}
7474
} else {
7575
this.$elm = el;
76+
this.anchor = el;
7677
this.$body.append(this.$elm);
7778
this.open();
7879
}
@@ -143,9 +144,9 @@
143144
}
144145
this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker);
145146
if(this.options.doFade) {
146-
this.$elm.css('opacity',0).show().animate({opacity: 1}, this.options.fadeDuration);
147+
this.$elm.css({opacity: 0, display: 'inline-block'}).animate({opacity: 1}, this.options.fadeDuration);
147148
} else {
148-
this.$elm.show();
149+
this.$elm.css('display', 'inline-block');
149150
}
150151
this.$elm.trigger($.modal.OPEN, [this._ctx()]);
151152
},

0 commit comments

Comments
 (0)