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

Web object Javascript with Captivate 9

Community Beginner ,
Oct 12, 2017 Oct 12, 2017

Hi All,

Really stuck here and hoping someone can help or point me in the right direction.

I have created a responsive HTML page which I have added as a web object to my Captivate project.  What I would like to do is call the Captivate JavaScript functions window.cpAPIInterface.....; from my HTML web object to advance the project to the next slide. This may sound unconventional but i am looking to give my project to look and feel of a website so i would have separate HTML web objects on each slide that would be linked through the Javascript calls, allowing the normal tracking of any Captivate project.

Thanks

770
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 , Oct 12, 2017 Oct 12, 2017

I use:

window.parent.window.cpAPIInterface.next();

Translate
Participant ,
Oct 12, 2017 Oct 12, 2017

You can advance the slide by using

parent.cp.playMovie()

in your web object html file

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 ,
Oct 12, 2017 Oct 12, 2017

If you want to go to next slide. Please use below line in your web object html file

parent.cp.goToNextSlide()

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 ,
Oct 12, 2017 Oct 12, 2017

I was hoping this could be added to a html button using the onclick  function like below but nothing happens.

<button type="button" onclick="parent.cp.playMovie()">Continue</button>

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, 2017 Oct 12, 2017

I use:

window.parent.window.cpAPIInterface.next();

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
New Here ,
Nov 29, 2024 Nov 29, 2024
LATEST

hi, you know how its go to a specific frame? i trying  window.cpAPIInterface.setVariableValue("cpCmndGotoFrameAndResume",270); but nothing happend, not works

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 ,
Oct 12, 2017 Oct 12, 2017

Thanks Guys, all were correct.

I had been trying to run the course locally and the Javascript wasn't working for some reason.  I  uploaded the course to the LMS  and added all 3 of your responses to an onclick event and Im happy to say it worked.

Thanks for your 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
Resources
Help resources