diff --git a/dialog.css b/dialog.css index 30cb212..83be4d9 100644 --- a/dialog.css +++ b/dialog.css @@ -1,8 +1,9 @@ .dialog { position: fixed; top: 150px; - left: 5%; - width: 90%; + left: 0; + right: 0; + margin: auto; z-index: 1000; text-align: center; } diff --git a/index.js b/index.js index 3a6448b..3ec511c 100644 --- a/index.js +++ b/index.js @@ -248,6 +248,7 @@ Dialog.prototype.show = function(){ // position document.body.appendChild(this.el); this._classes.remove('hide'); + this.el.style.width = query('.content', this.el).offsetWidth+"px"; this.emit('show'); return this; };