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>
<div id="wrapper">
<div class="box" id="box1"></div>
<div class="box" id="box2"></div>
</div>
CSS
#wrapper {
width: 11000px;
height: 11000px;
background: #ffeeee;
}
.box {
width: 100px; height: 100px;
background: grey;
}
#box2 {
background: purple;
}
JavaScript
// purple box should show down much faster than grey box on release
Draggable.create('#box1', {
throwProps: true,
bounds: '#wrapper'
});
Draggable.create('#box2', {
throwProps: true,
throwResistance: 9999999999999999999999999999999999999999,
bounds: '#wrapper',
});