Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular UI $modal component transition

Tags:

angularjs

Folks,

I am using the $modal component from Angular UI (http://angular-ui.github.io/bootstrap/). Whenever the modal opens it sort of scrolls down from the top. I simply want it to open instead of the fancy roll-from-top effect that it has right now

Plnkr: http://plnkr.co/edit/?p=preview

Anyone know how to achieve this ?

like image 371
runtimeZero Avatar asked Oct 23 '13 21:10

runtimeZero


2 Answers

Changing the option windowClass to "modal fade in" removes the animated slide.

var modalInstance = $modal.open({
      windowClass: "modal fade in"
 });

Plunker

In addition to that removing the fade class will believe it or not remove the fade effect.

like image 101
Jonathan Palumbo Avatar answered Oct 21 '22 14:10

Jonathan Palumbo


The trick is to use css to disable the animations. I've achieved it adding:

.modal.fade .modal-dialog {
    -webkit-transform: translate(0, 0);
    -ms-transform: translate(0, 0);
     transform: translate(0, 0);
}

To the stylesheet. See this plunkr: http://plnkr.co/edit/43oCGtDb3CaP9bwgW5gm?p=preview

like image 22
EzequielGolub Avatar answered Oct 21 '22 14:10

EzequielGolub