forked from gridstack/gridstack.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
title_drag.html
42 lines (40 loc) · 1.1 KB
/
title_drag.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title area drag</title>
<link rel="stylesheet" href="demo.css"/>
<script src="../dist/gridstack-all.js"></script>
<style type="text/css">
.card-header {
cursor: move;
min-height: 25px;
}
.card-header:hover {
background-color: rgba(0,0,0,0.1);
}
.card {
text-align: left;
}
</style>
</head>
<body>
<div class="container-fluid">
<h1>Title area drag</h1>
<br><br>
<div class="grid-stack">
<div class="grid-stack-item" gs-w="3" gs-h="3"><div class="grid-stack-item-content">
<div class="card-header">- Drag here -</div>
<div class="card">the rest of the panel content doesn't drag</div>
</div></div>
</div>
</div>
<script src="events.js"></script>
<script type="text/javascript">
let grid = GridStack.init({ handle: '.card-header' }); // drag by the header only
addEvents(grid);
</script>
</body>
</html>