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

Captivate Javascript jump to slide

Community Beginner ,
Nov 28, 2017 Nov 28, 2017

Hi Guys,

I have html web objects within each page of my Captivate Project and use

<button onclick="window.parent.window.cpAPIInterface.next();">Next</button> to move to the next slide, I would also like to have the option to jump to a slide (name or number).  Any help would be greatly appreciated

Thanks

TOPICS
Advanced , Editing
5.3K
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

correct answers 1 Correct answer

People's Champ , Nov 28, 2017 Nov 28, 2017

The JavaScript for the jump is:

cpCmndGotoSlideByUIDAndResume = 4839;',

You can get the id's to jump to like so:

var getSlides = cp.model.data.project_main.slides.split(",");

window.cpCmndGotoSlideByUIDAndResume = getSlides[2].substring(5, getSlides[2].length);

the "2" in bold (getSlides[2].) is the slide to jump to, it is zero based, so the code above jumps to slide 3.

Translate
People's Champ ,
Nov 28, 2017 Nov 28, 2017

The JavaScript for the jump is:

cpCmndGotoSlideByUIDAndResume = 4839;',

You can get the id's to jump to like so:

var getSlides = cp.model.data.project_main.slides.split(",");

window.cpCmndGotoSlideByUIDAndResume = getSlides[2].substring(5, getSlides[2].length);

the "2" in bold (getSlides[2].) is the slide to jump to, it is zero based, so the code above jumps to slide 3.

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
Community Beginner ,
Jan 10, 2018 Jan 10, 2018

Thanks for you help

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
Participant ,
May 30, 2018 May 30, 2018

Can't get it to work

Could you pls explain where to put the code to figure out the ID's to jump to?

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
Advisor ,
May 30, 2018 May 30, 2018

I just use the  Execute JavaScript  action for the OnSuccess  event with the following...

     window.parent.cpAPIInterface.gotoSlide(1);

Where 0 is slide 1

1 is slide 2

2 is slide 3

etc.

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
Participant ,
Jun 01, 2018 Jun 01, 2018

ust be my bad but can't get it to work

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 ,
May 30, 2018 May 30, 2018

Or you can use this if HTML5 only:

This will jump to slide 26

window.cpCmndGotoSlide = 25;

window.cpCmndResume = 1;

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
Participant ,
Jun 01, 2018 Jun 01, 2018

want to hook this up to a button that's on a webpage inside my iFrame, any tips?

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 ,
Jun 01, 2018 Jun 01, 2018

window.parent.window.cpCmndGotoSlide = 25;

window.parent.window.cpCmndResume = 1;

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
Participant ,
Jun 03, 2018 Jun 03, 2018
LATEST

Works like a charm, many thanks for helping out!

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