Disable style on model load #30899
Unanswered
lilyntalmers
asked this question in
Help
Replies: 1 comment
-
Can try button.classList.remove("my_ar_button"); I would probably add a new css class to make the purpose more clear, semantically: .no-display {
display: none;
} <button id="my_ar_button" class="my_ar_button no-display" slot="ar-button">Show AR</button> modelViewer.addEventListener("load", function() {
button.classList.remove("no-display");
}); This way you can still use Compatibility: https://www.caniuse.com/?search=classList |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I am using
model-viewer
in GatsbyJS. This is what the code looks likeI am using this CSS for the button
I want this CSS to be disabled when the model is completely loaded so I can view the button.
In plain HTML website I used to use this Vanilla JavaScript code
So, how can I disable CSS
.my_ar_button {display: none;}
after the model is completely loaded?Beta Was this translation helpful? Give feedback.
All reactions