Twitter Bootstrap模态窗体:如何拖放?

编程入门 行业动态 更新时间:2024-10-27 14:21:22
本文介绍了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模态窗体:如何拖放?

本文发布于:2023-11-03 07:53:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1554618.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:窗体   拖放   模态   Twitter   Bootstrap

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!