Tommy
Tommy

Reputation: 149

A-Frame – Check which 360°-Image is active and display additional image

I'm just playing around with the 360° image gallery: https://aframe.io/examples/showcase/360-image-gallery/

How do I check which 360° image is currently active and display additional images?

Thanks in advance Thomas

Upvotes: 0

Views: 131

Answers (1)

Brandon Cheng
Brandon Cheng

Reputation: 84

You can check what image is currently active by using this line of code:

document.querySelector("#image-360").getAttribute("material").src

This grabs the with id = "image-360", so we can check what kind of image is being used. The attribute "material" is AFrame's object that is attached to so that can change the source image, texture, color, opacity and a few more things.

Adding additional images would require you to create either or and apply a .setAttribute("src", or );

Upvotes: 2

Related Questions