我想通过Bootstrap 2提供的模态窗体,可以移动(在灰色的背景上,通过拖放)。任何人都可以告诉我实现这一点的最佳做法是什么? p>
I would like to be able to move around (on the greyed-out background, by dragging and dropping) the modal form that is provided by Bootstrap 2. Can anyone tell me what the best practice for achieving this is?
推荐答案默认情况下,引导不附带任何拖放功能,但您可以在混合中添加一点点jQuery UI调用以获得您要查找的效果。例如,使用 draggable 从框架,您可以定位您的模态ID,以允许它在模式背景下拖动。
The bootstrap doesn't come with any dragging and dropping functionality by default, but you can add a little jQuery UI spice into the mix to get the effect you're looking for. For example, using the draggable interaction from the framework you can target your modal ID to allow it to be dragged around within the modal backdrop.
尝试这样:
JS
$("#myModal").draggable({ handle: ".modal-header" });演示,编辑此处。
更新: bootstrap3演示
更多推荐
Twitter Bootstrap模态窗体:如何拖放?
发布评论