Twitter Bootstrap modal on mobile devices

前端 未结 12 2029
忘了有多久
忘了有多久 2020-12-02 04:20

Bootstrap modals don\'t work correctly on Android and iOS. The issue tracker acknowledges the problem but does not offer a working solution:

Modals in 2.0 are broke

12条回答
  •  南方客
    南方客 (楼主)
    2020-12-02 05:03

    EDIT: An unofficial Bootstrap Modal modification has been built to address responsive/mobile issues. This is perhaps the simplest and easiest way to remedy the problem.

    There has since been a fix found in one of the issues you discussed earlier

    in bootstrap-responsive.css

    .modal { 
        position: fixed; 
        top: 3%; 
        right: 3%; 
        left: 3%; 
        width: auto; 
        margin: 0; 
    }
    .modal-body { 
        height: 60%; 
    }
    

    and in bootstrap.css

    .modal-body { 
        max-height: 350px; 
        padding: 15px; 
        overflow-y: auto; 
        -webkit-overflow-scrolling: touch; 
     }
    

提交回复
热议问题