Increase modal size for Twitter Bootstrap

前端 未结 17 1724
抹茶落季
抹茶落季 2020-12-12 11:44

I am trying to change the size of the modal form or rather - have it respond to the content I render there. I am using it to render a form and would prefer to deal with scro

17条回答
  •  青春惊慌失措
    2020-12-12 12:03

    Mixing up two methods for width and height and you have a good hack:

    CSS:

    #myModal .modal-body {max-height: 800px;}
    

    JQuery:

    $('myModal').modal('toggle').css({'width': '800px','margin-left': function () {return -($(this).width() / 2);}})
    

    This one is the one I use. It fixs the margin and the scrollbars issues for both width and height but it won't resize the modal to fit its content.

    Hope I was of help!

提交回复
热议问题