Skip to main content
Participant
Oct 12, 2017 1:45 PM UTC
Answered

Web object Javascript with Captivate 9

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

    This topic is closed to new replies. Start a new post to keep the conversation going.
    TLCMediaDesign
    TLCMediaDesignCorrect answer
    Inspiring
    Oct 12, 2017 3:47 PM UTC

    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>


    I use:

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

    6 replies

    Participant
    Oct 12, 2017 4:42 PM UTC

    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
    ankits61431843
    Inspiring
    Oct 12, 2017 1:49 PM UTC

    You can advance the slide by using

    parent.cp.playMovie()

    in your web object html file

    Translate
    ankits61431843
    Inspiring
    Oct 12, 2017 1:58 PM UTC

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

    parent.cp.goToNextSlide()

    Translate
    Participant
    Oct 12, 2017 2:42 PM UTC

    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