I want to make $uibModal modal transparent when drugging and opaque when stop dragging.
For now, I tried jQuery fadeTo() and fadeIn() methods on the draggable stop event and the mouseup() method. The modal becomes transparent but doesn't become opaque.
How can I do this animation? The plunker
.directive('uibModalWindow', [function() {
return {
link: function(scope, element, attr) {
console.log('element', element);
var dialog = element.find('.modal-dialog');
dialog.draggable({
handle: '.modal-header',
drag: function() {
$(this).fadeTo(1000, 0.8);
},
stop: function() {
$(this).fadeTo(1000, 1);
//$(this).fadeIn();
}
});
$('.modal-header').mouseup(function() {
dialog.fadeTo(1000, 1);
//dialog.fadeIn();
});
}
};
}]);
You do not need to attach to the mouseup event, just reset the opacity to 100% when the dragging event is over.
May also be useful to specify that the modal window must be in the foreground of all the other elements of the page, to do this, simply set the property
moveToToptotrue.See following please:
I hope it helps you, bye.