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

Controlling objects' visibility through captivate's JavaScript

Participant ,
Jun 09, 2016 Jun 09, 2016

Hello!  It seems like something that should be very easy, but I cant get it, and it's frustrating!  I need to trigger visibility of an object when a button is pressed and I'd like to do it in JavaScript rather than using Actions because this functionality needs to be repeated on multiple pages.

Currently I have the following code:

var slideNum = window.cpAPIInterface.getCurrentSlideIndex();      // to get current slide number

var CC = $("#CC_text_" + slideNum);                                             // to get a proper object name

after this I've tried a number of things to access this objects' visibility, but nothing worked so far. I thought it'd be as easy as CC.show(); or maybe setting visibilityState to "visible".  What am I missing?

224
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 Expert ,
Jun 09, 2016 Jun 09, 2016
LATEST

If this is for an HTML5 project I would suggest you investigate using the CpExtra widget and @syntax or #syntax.

hashSyntax – CpExtra 1.3 New Feature - YouTube

Captivate Action Extensions | Infosemantics Pty Ltd

This would allow you to very easily SHOW or HIDE objects on any slide in the project simply by including a key word in the object name.  You don't need to know any JavaScript to pull this off.

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