make draggable class for possible future re-use
This commit is contained in:
parent
aefd45f436
commit
d563e8ba3a
3 changed files with 8 additions and 2 deletions
|
@ -55,6 +55,9 @@
|
|||
z-index: 999;
|
||||
|
||||
}
|
||||
#draggable{
|
||||
cursor:move
|
||||
}
|
||||
|
||||
#DraggableTitleBar {
|
||||
z-index: 999;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<body>
|
||||
<div id="infoContainer">
|
||||
<div id="DraggableTitleBar">openOutpaint 🐠</div>
|
||||
<div id="DraggableTitleBar" class="draggable">openOutpaint 🐠</div>
|
||||
<div id="info" class="info" style="min-width:200px;">
|
||||
|
||||
<label for="host">Host</label>
|
||||
|
|
|
@ -5,7 +5,10 @@ function dragElement(elmnt) {
|
|||
p2 = 0,
|
||||
p3 = 0,
|
||||
p4 = 0;
|
||||
document.getElementById('DraggableTitleBar').onmousedown = dragMouseDown;
|
||||
var draggableElements = document.getElementsByClassName('draggable');
|
||||
for (var i = 0; i < draggableElements.length; i++) {
|
||||
draggableElements[i].onmousedown = dragMouseDown;
|
||||
}
|
||||
|
||||
function dragMouseDown(e) {
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue