Captions JavaScript not working anymore

Hello all!

I've been using this script

if (/_html5.html/.test(window.location.href)) {
if (!window.alteredCaptions){
var sheet = document.createElement('style');
sheet.innerHTML = ".caption{font-size:175% !important;}";
document.body.appendChild(sheet);
window.alteredCaptions = true;
}
}

when trying to make captions in Storyline compliant. It doesn't seem to work anymore. Any changes to Storyline I'm unaware of? Any (other) workarounds?

Best regards

Michael

8 Replies
Matthew Bibby

Hey Michael,

Articulate have changed the way they name files when publishing just to HTML5.

If you use this code instead, you should be good:

 if (!window.alteredCaptions){
var sheet = document.createElement('style');
sheet.innerHTML = ".caption{font-size:175% !important;}";
document.body.appendChild(sheet);
window.alteredCaptions = true;
}
Jerry Beaucaire

If I wanted to use this, what would I need to add to force CAPTIONS to turn on for a specific slide where I was using this?

I have Spanish "content" available all through a course, but on one slide I have a video in english where we have created Spanish captions.  I would like to:

a) make the captions come on automatically controlled by a variable "Spanish=True"

b) have the captions be large

 

Thanks in advance.

Karen Cooper

Hi,

Based on the above change to the JavaSrript Michael B. suggested above for changing the font size, it seems this should work for changing the captions  location. However, I'm having no luck. I must be missing something?:

if (!window.movedCaptions){

var sheet = document.createElement('style');

sheet.innerHTML = ".caption{margin-bottom: 560px;}";

document.body.appendChild(sheet);

window.movedCaptions = true;

}

I'd appreciate any help.

Thanks!

Karen