Skip to main content
Participating Frequently
August 3, 2011
Beantwortet

Captivate: Using Javascript to show/hide text captions

  • August 3, 2011
  • 2 Antworten
  • 6028 Ansichten

Hello,

I want to show/hide a text caption using javascript. I can't find the way of doing it with advanced actions. I dont know if it's because it belongs to a question slide in a pool. Does somebody knows if it's possible and how it can be done??

Dieses Thema wurde für Antworten geschlossen.
Beste Antwort von Steve Howard, ACP

There's nothing wrong with your English - no need to apologise  :-)

I just tested this. Seems to work for me to create an advanced action that will show my custom caption if I set a custom Visited variable. Rather than xplain it, I attached a word doc with some screen shots and a sample CPTX file. File is Captivate 5, but same should work in 5.5

Steve

2 Antworten

Legend
August 4, 2011

I'd approach this a bit differently.  Instead of hiding/showing captions, I would simply use a variable that gets displayed in a text caption... then use an Advanced Action or JS to change the value of that variable being displayed in the caption.

Jim Leichliter

RodWard
Community Expert
Community Expert
August 4, 2011

Jim is THE JavaScript expert I was referring to before.

Over to you Jim!

Participating Frequently
August 4, 2011

Thank u very much RodWar!

Jim, that's what I intended to do and the only thing stopping me was the length.... Now that I know how to put a max length I'll be ok!!

You are right, instead of setting my variables with javascript I'm gonna do it with Advanced Actions... Ii think I'll have no p roblem with that.

I'm reassured that your advice coincides with what I was already doing... I was starting to think that It was not possible...

Again thanks

Rose

Steve Howard, ACP
Inspiring
August 3, 2011

Why do you need to use JS?

There are Show and Hide actions that you can access with or without

Advanced Actions. Do they not do what you need?

Steve

Participating Frequently
August 3, 2011

Thank you for answering.

In fact I want to make reviews of a quiz with all random questions.

But it seems to me that Captivate 5.5 can only set reviews for non answered questions, and the text will be the same.

I would like a diferent text caption to appear on each question slide only during the revision.

Beacause of this I wanted to use Advanced Actions, in each question slide to make appear the Caption Text after going to the next slide, or when entering the Results slide. The problem is that the object Text Caption does not appear anymore in the Advanced Action Editor.

This is why I would like to know how to Hide/Show a Text Caption using JP.

Sorry for my bad english.

Rose

Steve Howard, ACP
Inspiring
August 3, 2011

There's nothing wrong with your English - no need to apologise  :-)

I just tested this. Seems to work for me to create an advanced action that will show my custom caption if I set a custom Visited variable. Rather than xplain it, I attached a word doc with some screen shots and a sample CPTX file. File is Captivate 5, but same should work in 5.5

Steve