| 1 |
<!DOCTYPE html> |
| 2 |
|
| 3 |
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<meta charset="utf-8"> |
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1"> |
| 7 |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> |
| 8 |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> |
| 9 |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> |
| 10 |
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> |
| 11 |
<script> |
| 12 |
jQuery(function($) { |
| 13 |
var panelList = $('#draggablePanelList'); |
| 14 |
|
| 15 |
panelList.sortable({ |
| 16 |
// Only make the .panel-heading child elements support dragging. |
| 17 |
// Omit this to make then entire <li>...</li> draggable. |
| 18 |
handle: '.panel-heading', |
| 19 |
update: function() { |
| 20 |
$('.panel', panelList).each(function(index, elem) { |
| 21 |
var $listItem = $(elem), |
| 22 |
newIndex = $listItem.index(); |
| 23 |
|
| 24 |
// Persist the new indices. |
| 25 |
}); |
| 26 |
} |
| 27 |
}); |
| 28 |
}); |
| 29 |
</script> |
| 30 |
<style type="text/css"> |
| 31 |
body { |
| 32 |
overflow-y: scroll; |
| 33 |
} |
| 34 |
.panel-resizable { |
| 35 |
resize: vertical; |
| 36 |
overflow-y: scroll; |
| 37 |
padding: 0px; |
| 38 |
} |
| 39 |
/* show the move cursor as the user moves the mouse over the panel header.*/ |
| 40 |
.panel-heading { |
| 41 |
cursor: move; |
| 42 |
} |
| 43 |
.gantt { |
| 44 |
width: 100%; |
| 45 |
margin: 0px; |
| 46 |
} |
| 47 |
</style> |
| 48 |
</head> |
| 49 |
<style> |
| 50 |
.gantt { |
| 51 |
witdh: 100%; |
| 52 |
} |
| 53 |
</style> |
| 54 |
<body> |
| 55 |
|
| 56 |
<nav class="navbar navbar-light bg-light"> |
| 57 |
<form class="form-inline"> |
| 58 |
<button class="btn btn-outline-success" type="button">Button</button> |
| 59 |
</form> |
| 60 |
</nav> |
| 61 |
<ul id="draggablePanelList" class="list-unstyled"> |
| 62 |
<li class="panel panel-info"> |
| 63 |
<div class="panel-heading">head1</div> |
| 64 |
<div class="panel-body panel-resizable"> |
| 65 |
<object class="gantt" type="image/svg+xml" data="drawgantt-svg.php?width=2234"></object> |
| 66 |
</div> |
| 67 |
<div class="panel-footer">foot1</div> |
| 68 |
</li> |
| 69 |
<li class="panel panel-info"> |
| 70 |
<div class="panel-heading">head2</div> |
| 71 |
<div class="panel-body panel-resizable"> |
| 72 |
<object class="gantt" type="image/svg+xml" data="drawgantt-svg.php?width=2234"></object> |
| 73 |
</div> |
| 74 |
<div class="panel-footer">foot2</div> |
| 75 |
</li> |
| 76 |
</ul> |
| 77 |
</body> |
| 78 |
</html> |