Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('.ani').each(function() {
- var split1 = new SplitText('.txt', {type:"chars, words"});
- var split2 = new SplitText('.hover', {type:"chars, words"});
- var numChars1 = split1.words.length;
- var numChars2 = split2.words.length;
- for(var i = 0; i < numChars2; i++){
- TweenMax.set(split2.chars[i], {
- y: 30 * Math.random()
- });
- }
- $(this).mouseover(function(){
- for(var i = 0; i < numChars1; i++){
- TweenMax.to(split1.chars[i], 1, {
- y: -30 * Math.random(),
- }, .055 );
- }
- TweenMax.staggerTo(split2.chars, 0.3, {
- y: 0
- }, .055 );
- });
- $(this).mouseleave(function(){
- TweenMax.staggerTo(split1.chars, 0.3, {
- y: 0
- }, .055 );
- for(var i = 0; i < numChars2; i++){
- TweenMax.to(split2.chars[i], 1, {
- y: 30 * Math.random(),
- }, .055 );
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement