DIV name doesn´t show up correctly!

Problem: DIV name doesn´t show up correctly !

Saola Animate version: 2.7x

OS: Windows 8.1

Inside Saola you can create different elements. If you create a “Rectangle-Div” you can define the name of the Element (auto name is: Div_1), the class-name, etc. But after publishing the given name doesn´t show up. If i check it with my Browser (google chrome) it shows me something like:

<div id="sl-elem-vZdnwbHd-1-2" ........

This is strange. Because inside Saola the names are correctly written. This is a problem, because i can´t access these elements from my external JS-code (i can, but it is a mess to rename 100x elements).

Do i miss something ? A checkbox, maybe ? Is there a (automatic) workaround ? Or is it a bug and i need to update ?

Cheers

Hi,

What you see in the browser in the id of the DOM element associated with Saola Animate element.
DOM id need to be unique in the HTML document so Saola Animate doesn’t use element name for DOM id.
Element name is used to get the element using Saola Animate APIs.
After that, you can make change to the element using element methods.
You can also get the associated DOM from the element.
For example:

  var element = doc.getElement('element name');
  // element DOM
  var node = element.dom;
  // change element fill color
  element.fillSolid('red');

For list of APIs, please refer to JavaScript APIs section in the user manual. APIs are also listed in the script editor:

Regards

Ah okay.

Thanks a lot for this Hints. Exactly what i was searching for. Now everything works like expected ! Great !
Problem solved ! :nerd_face:

Cheers.