Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"drag and drop"
Bootstrap 3.0.0 Snippet by
evarevirus
3.0.0
Preview
HTML
View Full Screen
Fork
Fork this
5.4K
 
4 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html><html lang='en' class=''> <head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/aspencer/pen/VLLavj?depth=everything&order=popularity&page=12&q=Builder&show_forks=false" /> <style class="cp-pen-styles">.example_wrapper { max-width: 1000px; margin: 30px auto; } .sortable_box { border-left: 3px solid #aaa; } .sortable_box_control { float: left; margin-left: 5px; text-align: center; } .sortable_box_control a { display: block; color: #aaa; } .sortable_box_control a:hover { color: #999; } .sortable_box_control a:active { color: #777; } .layout_section_control { float: left; margin-left: 5px; text-align: center; font-size: 21px; } .layout_section_control a { display: block; color: #aaa; } .layout_section_control a:hover { color: #999; } .layout_section_control a:active { color: #777; } .layout_sections { padding: 0; margin: 0; list-style: none; } .layout_sections > li + li { margin-top: 10px; } .layout_sections > li.placeholder { border: 1px dashed #aaa; border-left: 3px solid #aaa; height: 100px; } .layout_section { background-color: #dddddd; padding: 10px 10px 10px 0; border-radius: 4px; } .layout_section > .sortable_box_control { font-size: 21px; } .section_control { margin-left: 40px; margin-top: 10px; text-transform: uppercase; font-size: 12px; } .section_control a { color: #999; } .sections_control { margin-top: 10px; text-transform: uppercase; font-size: 12px; } .sections_control a { color: #999; } .layout_rows { list-style: none; } .layout_rows li.placeholder { background-color: #eeeeee; position: relative; border: 1px dashed #aaa; border-left: 3px solid #aaa; height: 50px; } .layout_rows > li + li { margin-top: 10px; } .layout_row { border-radius: 3px; min-height: 50px; padding: 0; background-color: #eeeeee; } .layout_row > .sortable_box_control { font-size: 16px; margin-right: 10px; margin-top: 2px; } .layout_row_columns { overflow: hidden; padding: 10px 0; /* margin-left: 30px; margin-right: 10px; padding: 3px 0; */ } .layout_row_column { border-bottom: 1px solid #ccc; padding-bottom: 10px; } .column_control { overflow: hidden; padding: 0; } .column_control a { color: #909090; font-size: 11px; text-transform: uppercase; } .layout_column_edit { float: left; } .layout_column_add_module { float: right; } /* */ .layout_modules { list-style: none; padding: 0; margin: 0; } .layout_modules > li.placeholder { height: 0px; background-color: #fafafa; } .layout_module { background-color: #fafafa; padding: 5px 10px; } .layout_modules > li + li { margin-top: 5px; } body.dragging, body.dragging * { cursor: move !important; } .dragged { position: absolute; opacity: 0.5; z-index: 2000; } /* ol.example li.placeholder { position: relative; border-style: dashed; } ol.example li.placeholder:before { position: absolute; ----- Define arrowhead content: ''; width: 0; height: 0; border-style: solid; border-width: 5px 0 5px 5px; border-color: transparent transparent transparent #007bff; } */ </style></head><body> <html> <head> <title>Layout Builder Sortable Proof-of-Concept</title> <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <!--script src='jquery-sortable/source/js/jquery-sortable.js'></script--> <script src='https://rawgit.com/johnny/jquery-sortable/master/source/js/jquery-sortable-min.js'></script> <script src="script.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="example_wrapper"> <ol class="layout_sections"> <li class="layout_section sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_section_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('section options (id, class, background, etc)');" class="layout_section_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <ol class="layout_rows"> <li class="layout_row sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_row_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('row options (id, class)');" class="layout_row_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <div class="layout_row_columns"> <div class="container-fluid"> <div class="row"> <div class="col-xs-4"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module A</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> <div class="col-xs-4"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module B</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> <div class="col-xs-4"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module C</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> </div> <!-- .row --> </div> <!-- .container-fluid --> </div> <!-- .layout_row_columns --> </li> <li class="layout_row sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_row_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('row options (id, class)');" class="layout_row_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <div class="layout_row_columns"> <div class="container-fluid"> <div class="row"> <div class="col-xs-4"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module D</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> <div class="col-xs-8"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module E</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> </div> <!-- .row --> </div> <!-- .container-fluid --> </div> <!-- .layout_row_columns --> </li> <li class="layout_row sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_row_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('row options (id, class)');" class="layout_row_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <div class="layout_row_columns"> <div class="container-fluid"> <div class="row"> <div class="col-xs-8"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module F</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> <div class="col-xs-4"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module G</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> </div> <!-- .row --> </div> <!-- .container-fluid --> </div> <!-- .layout_row_columns --> </li> </ol> <div class="section_control"> <a href="javascript:;" class="layout_column_add_row"><i class="fa fa-plus"></i> Add Row</a> </div> <!-- .column_control --> </li> <li class="layout_section sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_section_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('section options (id, class, background, etc)');" class="layout_section_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <ol class="layout_rows"> <li class="layout_row sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_row_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('row options (id, class)');" class="layout_row_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <div class="layout_row_columns"> <div class="container-fluid"> <div class="row"> <div class="col-xs-6"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module 1</li> <li class="layout_module sortable_box">Module 2</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> <div class="col-xs-6"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module 3</li> <li class="layout_module sortable_box">Module 4</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> </div> <!-- .row --> </div> <!-- .container-fluid --> </div> <!-- .layout_row_columns --> </li> <li class="layout_row sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_row_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('row options (id, class)');" class="layout_row_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <div class="layout_row_columns"> <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module 6</li> <li class="layout_module sortable_box">Module 7</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-12 --> </div> <!-- .row --> </div> <!-- .container-fluid --> </div> <!-- .layout_row_columns --> </li> <li class="layout_row sortable_box"> <div class="sortable_box_control"> <a href="javascript:;" class="layout_row_drag"><i class="fa fa-arrows"></i></a> <a href="javascript:alert('row options (id, class)');" class="layout_row_edit"><i class="fa fa-bars"></i></a> </div> <!-- .sortable_box_control --> <div class="layout_row_columns"> <div class="container-fluid"> <div class="row"> <div class="col-xs-4"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module 8</li> <li class="layout_module sortable_box">Module 9</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> <div class="col-xs-8"> <div class="layout_row_column"> <ol class="layout_modules"> <li class="layout_module sortable_box">Module 10</li> <li class="layout_module sortable_box">Module 11</li> </ol> </div> <!-- .layout_row_column --> <div class="column_control"> <a href="javascript:;" class="layout_column_edit"><i class="fa fa-bars"></i></a> <a href="javascript:;" class="layout_column_add_module"><i class="fa fa-plus"></i> Add Module</a> </div> <!-- .column_control --> </div> <!-- .col-xs-6 --> </div> <!-- .row --> </div> <!-- .container-fluid --> </div> <!-- .layout_row_columns --> </li> </ol> <div class="section_control"> <a href="javascript:;" class="layout_column_add_row"><i class="fa fa-plus"></i> Add Row</a> </div> <!-- .column_control --> </li> </ol> <div class="sections_control"> <a href="javascript:;" class="layout_column_add_section"><i class="fa fa-plus"></i> Add Section</a> </div> <!-- .column_control --> </div> <!-- .example_wrapper --> </body> </html> <script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script> <script >/* global $ */ 'use strict'; $(document).ready(function() { $('.layout_rows').sortable({ group: 'layout_rows', containerSelector: '.layout_rows', itemSelector: '.layout_row', handle: '.layout_row_drag' }); $('.layout_sections').sortable({ containerSelector: '.layout_sections', itemSelector: '.layout_section', handle: '.layout_section_drag' }); $('.layout_modules').sortable({ group: 'layout_modules' }); $('.layout_column_edit').on('click', function() { window.alert('column options (id, class)'); }); $('.layout_column_add_module').on('click', function() { window.alert('add module dialog (module selection)'); }); $('.layout_column_add_row').on('click', function() { window.alert('add row dialog (row layout selection)'); }); $('.layout_column_add_section').on('click', function() { window.alert('adds a section to the list'); }); }); //# sourceURL=pen.js </script> </body></html>
Related:
See More
Template
Vue Material Kit PRO
486.9K
222
Bootstrap Drag and Drop Upload
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76