Replies: 3 comments 3 replies
-
Can you describe in what way our examples don't work? A screen recording would be helpful. The hotspot elements can have arbitrary children, so put some |
Beta Was this translation helpful? Give feedback.
-
Hey, thanks for the answer! Just about to jump on a call but the example issue is that the foot hotspot doesn't seem to do anything and the hand hotspot doesn't disappear. Will do a vid later if you need it. As for the html side, I am totally crap at it / just learning: otherwise all of your examples have been nothing but fantastic in helping: I just need to figure out how to do what you suggested :) |
Beta Was this translation helpful? Give feedback.
-
Dunno if this could help but you should use onclick or eventListener functions. https://developer.mozilla.org/fr/docs/Web/API/GlobalEventHandlers/onclick / https://developer.mozilla.org/fr/docs/Web/API/EventTarget/addEventListener. // I map an array from an api with which i show /hide and create each button on the spot to which i add an onclick function as below.
spot.onclick = (e)=>{
//e.preventDefault();
const isFound = bones.some(element => {
if (element.nom.toLowerCase().replace(/\s/g, '') === nomOs.toLowerCase().replace(/\s/g, '')) {
if(element.description && element.description !== ""){
// return nomOs + "\n\r" + element.description;
Swal.fire({
title:nomOs,
text:element.description
})
}else{
Swal.fire(nomOs)
}
}
});
} You just need to remove the comparison part which is something i do since the buttons are generated from an api |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there any way to have a click on a hotspot pop up a text or, better yet, text and window info card (which disappears on the next click?)
Racking my brain and google to figure this out: any html code examples would be a great help!
(the samples on the modelviewer docs don't show this // and they seem to not work either) .. and I don't want the info boxes showing until the click happens .. but all i can get from modelviewer is the on-screen label for the hotspot (which i also don't want)
thanks!
Beta Was this translation helpful? Give feedback.
All reactions