Forum Discussion
Storyline360, Animation and GSAP ( Greensock )
I purchased Club Greensock, and I have not been able to successfully get SplitText plugin to work. Any idea what I am missing here:
================ code ==============
//name the vars of elements on the slide
var txt1 = document.querySelectorAll("[data-acc-text='text1']");
//load in the plugins
dynamicallyLoadScripts([
"https://(our server site is here)/greensock/minified/SplitText.min.js",
], onLoadScripts);
function onLoadScripts() {
split = new SplitText(txt1, {type:"chars"})
animation.from(split.chars, {opacity:0, y:50, ease:"back(4)", stagger:{
from:"end", //try "center" and "edges"
each:0.05
}})
}
//the function that look for and loads the urls
function dynamicallyLoadScripts(urls, onComplete) {
if (typeof urls === "string") {
urls = [urls];
}
let toLoad = urls.length;
urls.forEach(function(url) {
let script = document.createElement("script");
script.src = url;
document.head.appendChild(script);
script.addEventListener("load", function() {
if (!--toLoad) {
onComplete && onComplete();
}
})
});
}
SplitText only works for normal DOM text, not for SVG text <tspan> (which is used by storyline for text)
https://greensock.com/forums/topic/12165-splittext-with-svg-text-element-problems/
(Posted August 6, 2015 - I do not believe that anything has changed)
- PhilMayor2 years agoSuper Hero
Jurgen would it work with the accessible text which is not meant to be SVG based
Sent from my iPhone
- Jürgen_Schoene_2 years agoCommunity Member
probably accessible text could work - but I have not tested it
the test would only be worth it if articulate solved the problem with the annoying scroller in accessible text mode
- PhilMayor2 years agoSuper Hero
@Jurgen I have an unrelated question, I want to copy code from a textbox into clipboard on the users machine.
My workaround at the moment is to pull the code from a text variable and then copy into the clipboard and that works, is there any way to use the contents of a textbox in storyline or am I chasing the impossible?
What I have works just wanted to make it an elegant solution.