Multiple ID's for model-viewer #3187
Answered
by
SimonKefas
SimonKefas
asked this question in
Q&A
-
I am trying to add the reveal and toggle-model ID's. The important thing is not necessary having 2 ID's, but to have the 2 functions i want at the same time. The first one is to add the; and the second one is to add the toggle-model; <script> const models = ['shishkebab.glb', 'Astronaut.glb']; const toggleModel = document.querySelector('#toggle-model'); let j = 0; setInterval(() => toggleModel.setAttribute('src', `../../shared-assets/models/${models[j++ % 2]}`), 2000); </script>Would be really helpful if you had some insight on this:)) |
Beta Was this translation helpful? Give feedback.
Answered by
SimonKefas
Feb 8, 2022
Replies: 1 comment
-
Lol, just put the same name on the ID for both codes :))) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
SimonKefas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lol, just put the same name on the ID for both codes :)))