How to get twitter bootstrap modal to close (after initial launch)

前端 未结 10 905
半阙折子戏
半阙折子戏 2020-12-24 04:13

I\'m very much a noob, so I think I\'m overseeing something (probably obvious) with twitter bootstrap modal. What I am trying to do is get a modal to launch only on mobile.

10条回答
  •  离开以前
    2020-12-24 04:47

    I had problems closing the bootstrap modal dialog, if it was opened with:

    $('#myModal').modal('show');
    

    I solved this problem opening the dialog by the following link:

    Open my dialog
    

    Do not forget the initialization:

    $('#myModal').modal({show: false});
    

    I also used the following attributes for the closing button:

    data-dismiss="modal" data-target="#myModal"
    

提交回复
热议问题