-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
35 lines (29 loc) · 907 Bytes
/
app.js
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
/**
* Created by ene on 24.07.2015.
*/
addEventListener('DOMContentLoaded', function(evt){
var allDivs = document.querySelectorAll('div')
for (i = 0; i != allDivs.length; i++) {
allDivs[i].setAttribute('class', 'draggable')
}
// if you have multiple .draggable elements
// get all draggie elements
var draggableElems = document.querySelectorAll('.draggable');
// array of Draggabillies
var draggies = []
// init Draggabillies
for (var i = 0, len = draggableElems.length; i < len; i++) {
var draggableElem = draggableElems[i];
var draggie = new Draggabilly(draggableElem, {
// options...
});
draggies.push(draggie);
}
console.log('>> drag-elements', draggableElems)
})
function changeZ (){
if (document.querySelector('#inputDiv').style['zIndex'] == 1) {
document.querySelector('#inputDiv').style['zIndex'] = 0
}
else document.querySelector('#inputDiv').style['zIndex'] = 1
}