Copy link to clipboard
Copied
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
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Thanks for you help
Copy link to clipboard
Copied
Can't get it to work
Could you pls explain where to put the code to figure out the ID's to jump to?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
ust be my bad but can't get it to work
Copy link to clipboard
Copied
Or you can use this if HTML5 only:
This will jump to slide 26
window.cpCmndGotoSlide = 25;
window.cpCmndResume = 1;
Copy link to clipboard
Copied
want to hook this up to a button that's on a webpage inside my iFrame, any tips?
Copy link to clipboard
Copied
window.parent.window.cpCmndGotoSlide = 25;
window.parent.window.cpCmndResume = 1;
Copy link to clipboard
Copied
Works like a charm, many thanks for helping out!