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

前端 未结 10 850
半阙折子戏
半阙折子戏 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 05:03

    .modal('hide') manually hides a modal. Use following code to close your bootstrap model

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

    Take a look at working codepen here

    Or

    Try here

    $(function () {
        $(".custom-close").on('click', function() {
            $('#myModal').modal('hide');
        });
    });
    
    
    
    
    
    
    
    
    

提交回复
热议问题