- Registriert
- 02.02.16
- Beiträge
- 85
Hey Community,
ich hab da mal ne Frage und zwar kriege ich es nicht hin das folgende Java-Scripts gleichzeitig laufen. Nehme ich eins raus, funktioniert das andere nur gleichzeitig will es irgendwie nicht
vielleicht weiß ja jemand woran das liegen könnte
ich hab da mal ne Frage und zwar kriege ich es nicht hin das folgende Java-Scripts gleichzeitig laufen. Nehme ich eins raus, funktioniert das andere nur gleichzeitig will es irgendwie nicht
Code:
<script type="text/javascript">
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
<script type="text/javascript">
function myFunction() {
document.getElementById("myDropdown1").classList.toggle("show1");
}
window.onclick = function(event) {
if (!event.target.matches('.dropbtn1')) {
var dropdowns = document.getElementsByClassName("dropdown-content1");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show1')) {
openDropdown.classList.remove('show1');
}
}
}
}
</script>
vielleicht weiß ja jemand woran das liegen könnte