Add drag-and-drop movement to the bootstrap modal dialog box

Source: Internet
Author: User

Please download the bootstrap library and the jquery library for your own use <! DOCTYPEHTML><HTML><Headlang="en"> <Metacharset="UTF-8"> <title></title> <Linkhref="Bootstrap.min.css"media="Screen"rel="stylesheet"></Head><Body><!--Button Trigger modal--><Buttontype="button"class="btn btn-primary btn-lg"data-toggle="Modal"data-target="#myModal"> Open the Sample dialog box </Button><!--Modal--><Divclass="Modal Fade"id="Mymodal"tabindex="-1"role="Dialog"aria-labelledby="Mymodallabel"> <Divid="Modaldialog"class="Modal-dialog"role="Document"> <Divclass="Modal-content"> <Divclass="Modal-header"> <Buttontype="button"class="Close"data-dismiss="Modal"aria-label="Close"><spanaria-hidden="true">&times;</span></Button> <h4class="Modal-title"id="Mymodallabel"> Draggable window </h4> </Div> <Divclass="Modal-body"> Hold left button to start dragging it </Div> <Divclass="Modal-footer"> <Buttontype="button"class="Btn Btn-default"data-dismiss="Modal"> Close </Button> </Div> </Div> </Div></Div><Scriptsrc="Jquery-1.11.2.min.js"></Script><Scriptsrc="Jquery-ui.min.js"></Script><!--User Drag elements, Link: http://api.jqueryui.com/draggable/#method-disable/--><Scriptsrc="Jquery.ui.touch-punch.min.js"></Script><!--Mobile Device User drag elements, dependent juery-ui.min.js, link:http://touchpunch.furf.com/--><Scriptsrc="Bootstrap.min.js"></Script><Script> $(Document). Ready(function(){        $("#modalDialog").draggable();//Add drag and drop for modal dialog box $("#myModal"). css("Overflow","Hidden");//Suppress translucent background scrolling of modal dialog box})</Script></Body></HTML>

Add drag-and-drop functionality to the Bootstrap modal dialog box

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.