Forum Discussion
GSAP timeline to speedup / slowdown any animations on it
I have read your email and your question was
BTW I have another question, but it is for another function, do you know how a user can change the size of the closing caption by running a Java, I found some solution, but this one only works for one time.
I used:
Big size
if (!window.alteredCaptions) {
var sheet = document.createElement('style');
sheet.innerHTML = ".caption{font-size:180% !important;}";
document.body.appendChild(sheet);
window.alteredCaptions = true;
}
Small size
if (!window.alteredCaptions) {
var sheet = document.createElement('style');
sheet.innerHTML = ".caption{font-size:140% !important;}";
document.body.appendChild(sheet);
window.alteredCaptions = true;
}
Any advice for this?
this could be interesting for others
here is an example, to switch the CC size in the course
https://360.articulate.com/review/content/64b7f0b8-1cdc-4918-80bf-12eaf86edd11/review
prepare script -> on timeline starts - on every page* which uses CC (because of resume course)
if( !window.alteredCaptions ){
style = document.createElement('style');
style.textContent = `
.CC-small .caption {
font-size: 140% !important;
}
.CC-big .caption {
font-size: 180% !important;
}
`
document.body.appendChild(style);
window.alteredCaptions = true;
}
the button script (for 180%)
// reset
document.body.classList.remove('CC-small', 'CC-big');
// set
document.body.classList.add('CC-big');
the button script (for 140%)
// reset
document.body.classList.remove('CC-small', 'CC-big');
// set
document.body.classList.add('CC-small');
the button script for reset size
// reset
document.body.classList.remove('CC-small', 'CC-big');
to set "CC on"
if you wan't to store the state of the CC size - use a variable
* or once in story.html/index_lms.html or at the end of user.js
- AlheliRiosIxta3 years agoCommunity Member
Hi Jurguen,
I been having problems with my background music, when I speed down my audio, also the music slowdown, can you help me to identify what I'm doing wrong.
One more question, is there any way to add in the code that respects the speed of audio en video playback from one slide to another, because every time I advance to the next slide the user would have to click on speed +/-, right now it just works with audio, but if I have both this doesn't work :(
Please!!!!
Related Content
- 8 months ago
- 10 months ago