Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.