Check out “Clip” part of following page:
Example:
http://codepen.io/GreenSock/pen/17b1ea88b3066d2ee4de90cc65fc862e
Sample Code:
1 2 3 4 5 6 7 8 9 10 11 12 |
var tl = new TimelineMax({'onComplete': function(){ $this.css('z-index', 0); }}); var p = { top: 0, right: (visual_width + offset) + 'px', bottom: $(window).height() + 'px', left: offset + 'px' } tl.to($this, duration, {'clip': 'rect(' + p.top + ', ' + p.right + ', ' + p.bottom + ', ' + p.left + ')'}); |