Alternate Tween Properties - TweenMax
How do I make an alternate tween properties - tweenmax?
Adding a new "alternate" property for TweenMax.. What is a alternate tween properties - tweenmax? How do you make a alternate tween properties - tweenmax? This script and codes were developed by Elliot Geno on 11 September 2022, Sunday.
Alternate Tween Properties - TweenMax - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Alternate Tween Properties - TweenMax</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="bob"></div>
<div class="bob"></div>
<div class="bob"></div>
<div class="bob"></div>
<div class="bob"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Alternate Tween Properties - TweenMax - Script Codes CSS Codes
body { background: black; margin: 0; margin-top: 20vh;
}
.bob { width: 200px; height: 20px; background: #333; position: relative; display: block; margin: auto; margin-bottom: 10px; margin-top: 10px;
}
Alternate Tween Properties - TweenMax - Script Codes JS Codes
var items=document.querySelectorAll(".bob");
for(var i=0;i<items.length;i++){ TweenMax.to(items[i],.5,{x:i%2==0?"+=200":"-=200",opacity:0, delay:.1*i});
}
/* It would be a great thing to add to TweenMax that already handles an array of objects.
If you add this to where you set up your for-loop for multiple tweens, you first check to see if an alternate properties exist.
If it does, flip flop between both properties as you set up your tweens.
I could see a possible new custom property being added like this:
TweenMax.staggerFrom(".bob",.5,{opacity:0,x:"+=200",delay:1,alternate:{x:"-=200"}},.2);
UPDATE: I created a new version of TweenMax to do just this!
https://dl.dropboxusercontent.com/u/1256960/%20Research/JS/TweenMaxAlternate/index.html
Also added a topic on the Greensock Forums
https://greensock.com/forums/topic/12208-alternating-property-direction-with-any-array/
*/
Developer | Elliot Geno |
Username | pyrografix |
Uploaded | September 11, 2022 |
Rating | 3 |
Size | 2,215 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Gravitational Wave IS DARTH VADER | 6,134 Kb |
Following a Path | 2,019 Kb |
Prism | 2,843 Kb |
A Pen by Elliot Geno | 2,114 Kb |
Eye Bee M | 4,047 Kb |
One Percent | 2,919 Kb |
Solar Explorer | 3,333 Kb |
Swarm | 2,384 Kb |
Dot Hopper - Pagination | 2,579 Kb |
Stained Glass | 2,127 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by James Podles | Jpod | 2,656 Kb |
Tile Animation Thing | Frxnz | 4,332 Kb |
Tumblr API | Juanv911 | 2,436 Kb |
A Pen by Oliver Schafeld | Schafeld | 1,720 Kb |
Flex layout example | Mofny | 1,663 Kb |
Basic jQuery Filter list | Mtedwards | 2,464 Kb |
Typefaces with descriptions | Megandoty | 2,944 Kb |
Simple blog concept | Drew_mc | 2,666 Kb |
Cloud upload | Jaflo | 2,774 Kb |
Cars going | Netoguimaraes | 1,699 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!