Page 1 of 1

element IDs not visible in HTML?

Posted: Wed Oct 04, 2023 1:50 pm
by hromain
Hello,

I know that the skin editor allows you to name each skin element with a unique ID. However, upon investigating an exported project with Chrome's dev tools, I don't see the element IDs anywhere in the HTML (I do see the classes, but no IDs). Is there some kind of export setting I need to select in order to make the IDs visible in the code? Having unique element IDs is one of the major guidelines for web accessibility standards, and I'm hoping to have this project align.

Thanks!

Re: element IDs not visible in HTML?

Posted: Wed Oct 04, 2023 5:33 pm
by Hopki
Hi,
For skin IDs you need to look in the skin.js file not the HTML page.
Regards,

Re: element IDs not visible in HTML?

Posted: Thu Oct 05, 2023 4:23 pm
by thomas
Currently, we don't set the IDs as they may not be unique; for example, a hotspot template or a cloned element appears multiple times in the DOM.

You can also embed multiple panoramas on a single HTML page, which would make this worse. That is also why we prefer classes for custom styling.

If you only need the ID for certain elements, you could use, for example, the action - Start - Goto Url

Code: Select all

javascript:me._text_1.id="Text1";
or you could use a code block to do the same thing for more elements.

As Martin said, you can look at the skin.js file to get an idea of how the skin is assembled, and maybe you can find a better solution.

Re: element IDs not visible in HTML?

Posted: Mon Oct 09, 2023 2:47 pm
by hromain
Thanks for the insight, Thomas; I can definitely understand the logic there. Would you mind explaining a bit more about how to set the IDs for certain elements? I know how to set an action on Start, but I’m not sure how to use the Go To URL action to pull the ID from the skin.js file...