Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
such as link I intend to use it in my code that is:
<body>
<div id="quote">SplitText makes it easy to break apart the text in an HTML element so that each character, word, and/or line is wrapped in its own div tag.</div>
<button id="animate">animate</button>
<button id="r">animate</button>
</body>
<script type="text/javascript" src="js/plug/SplitTextPlugin.min.js"></script>
<script type="text/javascript" src="js/plug/TweenLite.min.js"></script>
<script type="text/javascript" src="js/plug/TimelineLite.min.js"></script>
<script type="text/javascript">
var tl = new TimelineLite, 
    mySplitText = new SplitText("#quote", {type:"words,chars"}), 
    chars = mySplitText.chars; //an array of all the divs that wrap each character

TweenLite.set("#quote", {perspective:400});

tl.staggerFrom(chars, 0.8, {opacity:0, scale:0, y:80, rotationX:180, transformOrigin:"0% 50% -50"}, 0.01, "+=0");

document.getElementById("animate").onclick = function() {
  tl.reverse();
}

document.getElementById("r").onclick = function() {
  tl.restart();
}
</script>


What I have tried:

i try to use splitText plugin but can't run this in my project.
Posted
Updated 18-Jun-16 11:58am
v2
Comments
Sergey Alexandrovich Kryukov 18-Jun-16 10:37am    
You need to explain your problem properly. You can click Improve question and explain everything better.
—SA
iman DA 18-Jun-16 18:00pm    
This is the code that I wrote.
phil.o 19-Jun-16 4:25am    
Yet, you still need to describe the issue properly.
And you may get a quicker/better answer by asking directly to people supporting this splittex plugin.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900