Copy link to clipboard
Copied
Hello! I do not have Captivate 10 (still on v9) but one of the colleagues was upgraded recently and commented that the script that I wrote a while ago does not work with Captivate v10.
Part of the script is trying to access a text caption and read its innerHTML. But apparently, when the function is executed immediately when you enter the slide, that element does not exist yet. Running that same function slightly later (for example using setTimeout) works just fine. Is this by design, or is this a bug?
Thanks!
I use a setInterval if I need to check something immediately. This happen a lot when manipulation the canvas elements. By the way, are you trying to get the text in a text caption? It is an image unless you are getting the accessibility paragraph.
in the onEnter event:
interval = setInterval( checkExists, 100, e );
and the function:
function checkExists( e )
{
if ( document.getElementById( 'barc' ) !== null )
{
clearInterval( interval );
interval = null;
initSlide( e );
}
}
Copy link to clipboard
Copied
I cannot speak about JS, but there is defnitely a bug with some On Enter advanced actions as well for HTML5 output. That bug was logged more than 7 months ago, still not solution. Your problem is probably linked to that same bug.
Copy link to clipboard
Copied
Thank you for replying!
Could you tell me what sort of issues that bug creates?
Copy link to clipboard
Copied
I had the problem that using micronavigation to replay a slide didn't work in HTML5 output, becasse the action On Enter didn't get done.
Copy link to clipboard
Copied
This might help as workaround. You could try wrapping your function into jquery's .ready function. It will only execute once all the DOM elements have been loading on the page.
$(document).ready(function(){
YOUR FUNCTION'S ACTIONS HERE
});
Copy link to clipboard
Copied
Thanks for your suggestion!
I'm afraid, however, that wouldnt wouldnt work, as the $(document).ready is already true by the time the On Load is executed (since On Load only runs when the page is loaded).
I did try it, through, to be sure - it resulted in the same problem.
Copy link to clipboard
Copied
I use a setInterval if I need to check something immediately. This happen a lot when manipulation the canvas elements. By the way, are you trying to get the text in a text caption? It is an image unless you are getting the accessibility paragraph.
in the onEnter event:
interval = setInterval( checkExists, 100, e );
and the function:
function checkExists( e )
{
if ( document.getElementById( 'barc' ) !== null )
{
clearInterval( interval );
interval = null;
initSlide( e );
}
}
Copy link to clipboard
Copied
Thanks - great suggestion!
I am targeting the accessibility layer. Everything worked great until Captivate 10.
Thank you again for help!