Twitter Bootstrap模态窗体:如何拖放? [英] Twitter Bootstrap Modal Form: How to drag and drop?

查看:100
本文介绍了Twitter Bootstrap模态窗体:如何拖放?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过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模态窗体:如何拖放?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆