I am trying to hide and show objects inside Captivate using Captivate JavaScript window, but even though it feels like it should be very easy to do, I cannot get my objects to show!
So far I've tried the following:
var slideNum = window.cpAPIInterface.getCurrentSlideIndex(); // to get current slide number
var CC = $("#CC_text_" + slideNum); // to get a proper object name as I have similar objects on every page
after that I tried standard JS approaches like CC.hide(); tried changing visibility, etc, but nothing works. Has anyone tried anything like this before?
Thank you!
I ran into this issue just today as luck would have it. The issue is that $("#CC_text_" + slideNum);
returns the accessibility object that is on top of you the object you want. The actual object is a canvas element underneath the accessibility object, and conveniently has the same id + "c". So you'll want:
$("#CC_text_" + slideNum + "c");
Additionally, it appears that objects that are hidden from output (failure captions etc) are set to display: block; visibility: hidden;
so .show()
won't work, you'll need to use .css('visibility', 'visible')