I tried the following:
-
I've found this solution that works better for me. You can use this:
$('.modal').css({
'width': function () {
return ($(document).width() * .9) + 'px';
},
'margin-left': function () {
return -($(this).width() / 2);
}
});
or this depending your requirements:
$('.modal').css({
width: 'auto',
'margin-left': function () {
return -($(this).width() / 2);
}
});
See the post where I found that:
https://github.com/twitter/bootstrap/issues/675