Forum Discussion
[JS] SET OBJECT POSITION
If I try to rebuild Przemyslaws Sample it works, when publishing to Web, but not when publishing to LMS / LRS as SCORM 1.2. Can somebody explain to me why? And if there is a way to adjust it so it works?
- MathNotermans-93 years agoCommunity Member
Both work when i test them. So should work on the LMS too. Guess it depends on if the Scorm is shown in an iframe and thus maybe the selection used doesnot work.
Also although the selection that is used works fine.. its quite dependant on the amount of elements you have on your timeline. If you have less or more...the selector needs to be different.let pilka = document.getElementsByClassName("slideobject-maskable")[13];
The number 13 relates to layer 14 in the timeline... its array based, so 0-13 from the bottom....
So if you change the amount of elements... well it wont work. Or change the order...then something else will move.document.querySelector("#slide-window > div > div > div.slide-transition-container > div > div.slide-layer.base-layer.shown > div:nth-child(14) > div");
This is the selector as copied from the running HTML...
I use the accessibility names as selector...for a imported image thats always the original name.
So for the ball thats like this...let pilka = document.querySelector("[data-acc-text='path859.png']");
how many other elements you add, what layer its on...this works always.