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

前端 未结 10 846
半阙折子戏
半阙折子戏 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:59

    According the documentaion hide / toggle should work. But it don't.

    Here is how I did it

    $('#modal-id').modal('toggle'); //Hide the modal dialog
    $('.modal-backdrop').remove(); //Hide the backdrop
    $("body").removeClass( "modal-open" ); //Put scroll back on the Body
    

提交回复
热议问题