question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to reveal only when model-viewer element is visible on the page

See original GitHub issue

In some cases the model-viewer might not be visible on page load:

  • Part of an image carousel (ex: it is on slide 4 of 5)
  • Below the fold

It could be beneficial to have an option to only reveal the viewer if is actually visible on the page. So when you get to the viewer in the carousel, it reveals. Same with when you scroll down the page and see the viewer element.

If preload is set, then the reveal is simply dismissing the poster. If preload is not set, then the loading + revealing happens as soon as the viewer is visible.

Suggestion:

  • reveal="visible"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pushmatrixcommented, Jun 5, 2019

Need to double check if the intersection observer works for cases where you unhide an element that had display: none on it.

0reactions
elalishcommented, Apr 17, 2020

I believe this is now the default behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<model-viewer> Examples and Documentation
This property, pronounced model-is-visible, is read-only. It returns true if the element is visible on the page (assuming there is an IntersectionObserver) ...
Read more >
The <model-viewer> web component
3D models ideally will be shown in a viewer that can work responsively on all browsers including smartphones, desktop, or even new head-mounted ......
Read more >
<model-viewer> - GitHub Pages
Use it like any other HTML element --> <model-viewer src="shared-assets/models/Astronaut.glb" ... Only glTF/GLB models are supported, see Supported Formats.
Read more >
<model-viewer> - Augmented Reality
Use it like any other HTML element --> <model-viewer src="examples/assets/Astronaut.glb" ... Only glTF/GLB models are supported, see Supported Formats.
Read more >
Model Viewer II - User Guide
The second option 'Preview' will show the animation in the 'preview' window and display a dummy camera in the main view showing the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found