Transform Orign
How do I make an transform orign?
Greensock forums:http://forums.greensock.com/topic/8200-animating-transform-origin/. What is a transform orign? How do you make a transform orign? This script and codes were developed by Rodrigo Hernando on 18 November 2022, Friday.
Transform Orign - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Transform Orign</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="div1"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Transform Orign - Script Codes CSS Codes
body
{ background:#444; margin:0;
}
#div1
{ width:200px; height:100px; position:relative; background:#00f; border:solid 2px #fff; border-radius:5px; margin:100px auto; margin-bottom:0; cursor: pointer;
}
Transform Orign - Script Codes JS Codes
var div1 = $("#div1"), tl1 = new TimelineMax({onReverseComplete:function(){this.restart(true)}}), transformOriginObj = {'left':0, 'top':0};
TweenLite.set(div1, {transformOrign:'0% 0%'});
tl1 .to(div1, 1, {rotation:45, transformOrigin:'0% 0%'}) .to(transformOriginObj, 1, {left:100, top:100, roundProps:'top, left', onUpdate:updateOrigin}) .to(div1, 1, {rotation:-45}, '-=1');
function updateOrigin() { TweenLite.set(div1, {transformOrigin:transformOriginObj.left + '% ' + transformOriginObj.top + '%'});
}
div1.click(function(){ tl1.reverse();
});
Developer | Rodrigo Hernando |
Username | rhernando |
Uploaded | November 18, 2022 |
Rating | 3 |
Size | 2,051 Kb |
Views | 32,384 |
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 |
Simple Slider Powered by GreenSock | 4,573 Kb |
Greensock Draggable latest update | 2,971 Kb |
Auto scroll to element offset | 2,549 Kb |
Circular Progress Bar | 4,985 Kb |
Animate SVG Gradient | 2,239 Kb |
Greensock Bezier Morph | 2,463 Kb |
Circular Bezier | 2,696 Kb |
Update tween progress with Draggable | 2,695 Kb |
Auto scroll to element offset 2 | 2,620 Kb |
Bezier Animation with straight paths | 2,087 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 |
The Rope | Chribbe | 2,886 Kb |
Reviews and Ratings Star | Zbnmstry | 1,591 Kb |
Display properties | Hamzaerbay | 1,886 Kb |
Gradients | Karpovsystems | 2,394 Kb |
Glowing Pulse Form | Jackrugile | 2,542 Kb |
Social buttons | Flacu | 2,022 Kb |
Isometric css island | Xaddict | 2,950 Kb |
Tab Menus | Zephyr | 3,180 Kb |
Ipad Mini Showcase | Hornebom | 10,479 Kb |
Popover Example | Seanboom | 2,429 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!