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

Captivate java script and the Playbar

New Here ,
Jun 14, 2023 Jun 14, 2023

I recently helped create a series of Captivate Courses and was able to successfully use javascript to enable and disable the Forward and Backward buttons in the Captivate supplied Playbar. For Example:

$("#" + "Forward").css("pointer-events","none");

$("#" + "Forward").css("pointer-events","auto");

For this course we also had situations where would have liked to have the Forward button jump to a particular slide (instead of just going the next slide). And the same for the Backward button. Is there any java script code that would make this work?

334
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 ,
Jun 14, 2023 Jun 14, 2023

Personally, I would disable the native playbar altogether and build my own navigation. You can easily enable and disable  your own buttons easier as well as jump to slides based on conditions.

 

Then you can create a button for nav and use a single line of code to jump to a slide of your choice.

 

cpCmndGotoSlide=value;

 

Change the word 'value' to reference the slide number of your choice.

Please note that the slide numbers in this context are zero indexed.

That means Slide 1 has a value of 0 and Slide 2 has a value of 1 - etc.

 

Of course, in this case, a simple action on the button for Jump to Slide would suffice.

If you start building in conditions - JavaScript can make short work of that.

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
LEGEND ,
Jun 15, 2023 Jun 15, 2023

If you include the progress bar in the default playbar I really would recommend to avoid the playbar but set up custom navigation. That is a lot easier than you think, at least if you are not in a fluid boxes project. You can use shape or images used as buttons on the master slide(s), even on the main master slide. Or for your particular question, use a shared action where the slide to which you want to navigate is a parameter.  The Expression command allows you to use the system variable cpCmndGotoSlide (index starts with 0!) and other slide variables (cpInfoCurrentSlide has an index starting with 1). So if you want to go to slide 5 the Expression will be:

Expression cpCmndGotoSlide = 4       and 4 can be a parameter in a shared action.

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 ,
Jun 15, 2023 Jun 15, 2023

We need to stick with the Captivate Playbar because our course is part of a curriculum that already uses it. How do we define the foward arrow in java script so we can apply the command (cpCmndGotoSlide = value) to it? So the forward arrow when clicked, will naviage to the slide we designate in the command.

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
LEGEND ,
Jun 16, 2023 Jun 16, 2023
LATEST

It would mean you need another value on each slide, you cannot have it in a permanent playbar. It would be possible with a shared action easily as I explained but it would need a custom button, not the one in the playbar. You didn't answer my question about the progress bar which can be scrubbed and override the settings of this 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
Resources
Help resources