这变得很烦人--当我点击Bootstrap下拉菜单中的一个项目时,下拉菜单没有关闭.我将其设置为当您单击下拉项时打开Facebox Lightbox,但它有一个问题.
我试过的
单击项目时,我try 了以下操作:
$('.dropdown.open').removeClass('open');
$('.dropdown-menu').hide();
That hides it, but then for some reason it won't open again.
As you can see I really need the dropdown to close, because it looks crappy when it stays open (mainly because the z-index
of the dropdown is higher than the Facebox modal box overlay.
为什么我不使用Bootstrap的内置模式框
如果你想知道我为什么不使用漂亮的模态盒子built into Bootstrap,那是因为:
- It doesn't have a way to load content into it with AJAX.
- You have to type HTML each time for the modal; with Facebox you can do a simple:
$.facebox({ajax:'/assets/ajax/dialogs/dialog?type=block-user&id=1234567'});
- It uses CSS3 animations to animate (which looks very nice) but in non-CSS3 browsers it just shows, which doesn't look that nice; Facebox uses JavaScript to fade in so it works in all browsers.