Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Using JS to get a slide's elements

Explorer ,
Oct 11, 2016 Oct 11, 2016

I can do this to get the elements in/on a slide

...

eventEmitterObj.addEventListener("CPAPI_SLIDEENTER", function(e) {

  var elems = e.Data.si;

};

but I need to get the elements in a JavaScript function independent from the slide enter event. Is there some other variable of object I can query to get the elements?

TOPICS
Advanced
439
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 12, 2016 Oct 12, 2016

Can you explain in more detail?

What are you trying to do?

You can get the si property of any slide. You must first access the slide in question through cp.model.data.project_main.slides

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 12, 2016 Oct 12, 2016

How do I get a slide's number using its label so that I can later call a

function to jump to it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Oct 12, 2016 Oct 12, 2016

You would need to loop through all of the slides and get the lb property, if it matches the label you are looking for, store the index in the variable.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 12, 2016 Oct 12, 2016
LATEST

Great. Thank you!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources