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"; } }); } function nordbahnview(){ var viewp = vcs.vcm.Framework.getInstance().viewpoints.NordBView vcs.vcm.Framework.getInstance().getActiveMap().gotoViewPoint(viewp); } document.addEventListener('touchstart', function addtouchclass(e){ // first time user touches the screen var drop = document.getElementById("dropdownMain") drop.classList.add('can-touch') drop.style.display = "none"; // add "can-touch" class to document root using classList API document.removeEventListener('touchstart', addtouchclass, false) // de-register touchstart event }, false) // 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(); // }); // 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"; // } // } // }