2

Is there a way to center the dialog windows of the Alertify Js plugin? http://alertifyjs.com

I have seen there is a property called position, but it does not support center position.

Thank you all.

elarmando
  • 569
  • 1
  • 7
  • 16
  • Are you talking about vertical center? Because it appears to already be centered horizontally in the [demos](http://alertifyjs.com/) – Kevin Jantzer Apr 05 '17 at 18:00

1 Answers1

6

If you modify the css you can achieve this:

.alertify .ajs-dialog {
    top: 50%;
    transform: translateY(-50%);
    margin: auto;
}

Before:

enter image description here

After:

enter image description here

Kevin Jantzer
  • 9,215
  • 2
  • 28
  • 52
  • Thanks Kevin, this is ok when the dialog is nos draggable. But when you drag the dialog, it moves to the top of the window. – elarmando Apr 06 '17 at 16:53
  • Use 'autoReset', false to avoid seting the position again on window resize alertify.confirm('autoReset: false').set('autoReset', false); – Nandakumar Sep 11 '17 at 10:45