gsap draggable throwResistance
by trkli
HTML
<script src="https://static.proto.io/js/plugins/greensock/1.19.0/TweenMax.js"></script>
<script src="https://static.proto.io/js/plugins/greensock/1.19.0/Draggable.js"></script>
<script src="https://static.proto.io/js/plugins/greensock/1.19.0/ThrowPropsPlugin.js"></script>
<div id="wrapper">
<div class="box" id="box1">
<a href="">link</a>
<img src="https://images.pexels.com/photos/414171/pexels-photo-414171.jpeg" alt="">
</div>
</div>
CSS
#wrapper {
width: 200px;
height: 200px;
overflow: hidden;
background: #ffeeee;
}
.box {
width: 1000px; height: 1000px;
background: grey;
overflow: hidden;
}
JavaScript
// purple box should show down much faster than grey box on release
Draggable.create('#box1', {
throwProps: true,
bounds: '#wrapper'
});