Bootstrap Modal Auto Align


When using bootstrap's modal plugin, sometimes you might have aligments issues, to fix them:
$('#youModal').modal().css(
                {
                    width: 'auto',
                    'margin-top': function () {
                        return -($(this).height() / 2);
                    },
                    'margin-left': function () {
                        return -($(this).width() / 2);
                    }
                })
Advertisements