cus_Menu.js 1.96 KB
Newer Older
Patrick's avatar
Patrick committed
1
2
3
4
5
6
7
8
9
10
11
12
var acc = document.getElementsByClassName("accordion");
            var i; 
            for (i = 0; i < acc.length; i++) {
              acc[i].addEventListener("click", function() {
                this.classList.toggle("active");
                var subMenu = this.nextElementSibling;
                if (subMenu.style.maxHeight) {
                    subMenu.style.maxHeight = null;
                } else {
                    subMenu.style.maxHeight = subMenu.scrollHeight + "px";
                } 
              });
Patrick's avatar
Patrick committed
13
14
15
16
17
            }

function nordbahnview(){
  var viewp = vcs.vcm.Framework.getInstance().viewpoints.NordBView
  vcs.vcm.Framework.getInstance().getActiveMap().gotoViewPoint(viewp);
18
19
20
21
}

document.addEventListener('touchstart', function addtouchclass(e){ // first time user touches the screen
  var drop = document.getElementById("dropdownMain")
Patrick's avatar
Patrick committed
22
23
    drop.classList.add('can-touch')
    drop.style.display = "none"; // add "can-touch" class to document root using classList API
24
    document.removeEventListener('touchstart', addtouchclass, false) // de-register touchstart event
25
26
}, false)

Patrick's avatar
Patrick committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// var dropD = document.getElementById("dropdownMain")
// var dropM = document.getElementById("dropdownMenu")
// var dropC = document.getElementById("dropdownContent")

// dropM


// function dropdownFunk() {
//   console.log("test")
//     if (dropD.className == "can-touch"){
//     if (dropC.style.display == "none" || dropC.style.display == ""){
//       dropC.style.display = "block";
//     } else if (dropC.style.display == "block"){
//       dropC.style.display = "none";
//     }
//    }
// };



//     $('#dropdownMain').on('touchstart click', function() {
//       console.log('test')
//       dropdownFunk();
//     });

52
53
54
55
56
57
58
59
60
// dropD.onclick = function(){
//   if (dropD.className == "can-touch"){
//     if (dropC.style.display === "none"){
//       dropC.style.display = "block";
//     } else if (dropC.style.display === "block"){
//       dropC.style.display = "none";
//     }
//   }
// }