Skip to main content
Inspiring
November 15, 2018
Question

Javascript Next and Previous Buttons

  • November 15, 2018
  • 1 reply
  • 1296 views

Hi,

So i am trying to create a Next and Previous button with Html, Css and Javascript. The reason for this is because it's retina friendly.

I have found this post: Javascript go to next slide from Web Object and tried to add the following line of code in my html file:

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

So the html file looks like this:

<html>

     <head>

          <link rel="stylesheet" type="text/css" href="style.css">

     </head>

     <body>

          <button class="volgende" type="button" onclick="parent.cp.goToNextSlide()">Go to next slide</button>

     </body>

</html>

I published the file on my webserver and added the link in a web object in Captivate.

Unfortunately the button doesn't work.

Does anyone knows what i'm doing wrong here?

This topic has been closed for replies.

1 reply

TLCMediaDesign
Inspiring
November 15, 2018

Where is the Web Object, that page you are linking to in relation to your Captivate published file?

Open the console and see what errors are being generated, if any. Press F12 in the browser.

Inspiring
November 15, 2018

The web object is in a folder on my webserver where my website is running aswell.

The following warnings and errors showing up in the console:

TLCMediaDesign
Inspiring
November 15, 2018

I don't think the code you are using is not going to work since the webpage is not actually a child of the Captivate file. It's just a link.

Don't have access to my server at the moment to test, but you could try this JS:

window.opener.cp.GoToNextSlide()