How to hide Twitter Bootstrap dropdown

后端 未结 24 2281
悲&欢浪女
悲&欢浪女 2020-12-13 03:37

This is getting annoying — when I click on an item in a Bootstrap dropdown, the dropdown doesn\'t close. I have it set up to open a Facebox lightbox when you click the dropd

24条回答
  •  执念已碎
    2020-12-13 03:46

    Try to open HTML with Bootstrap Modal, I use this code:

    $(function() {
         $('a[data-toggle=modal]').click(function(e) {
              e.preventDefault();
              var page = $(e.target).attr('href');
              var url = page.replace('#','');
              $(page).on('show', function () {
                  $.ajax({
                  url: "/path_to/"+url+".php/html/...",
                  cache: false,
                  success: function(obj){
                       $(page).css('z-index', '1999');
                       $(page).html(obj);
                  }
                  });
             })
         });
    }); 
    

    and the link is like this:

    PAGE
    

提交回复
热议问题