Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

TweenMax.killChildTweensOf()

TweenMax.killChildTweensOf( parent:Object, complete:Boolean ) :

[static] Kills all tweens of the children of a particular DOM element, optionally forcing them to completion first.

Parameters

parent: Object

The parent DOM element whose children’s tweens should be killed. Or selector text that gets passed to TweenLite.selector. For example, if “.myClass” is used (and jQuery or similar is used as TweenLite.selector), tweens of the children of any elements with the “myClass” class applied would be killed.

complete: Boolean

(default = false) — If true, the tweens will be forced to completion before being killed.

Details

Kills all tweens of the children of a particular DOM element, optionally forcing them to completion first. For example, if you have the following HTML:
And then let's say you create a tween of each of the elements (d1, d2, image, and d3) and then later you want to kill only the tweens of DOM elements that are children of d1 (which would be d2 and image in this example), you'd call TweenMax.killChildTweensOf( document.getElementById("d1") ).

TweenMax.to( document.getElementById("d2"), 1, {css:{left:100}});TweenMax.to( document.getElementById("image"), 1, {css:{left:100}});TweenMax.to( document.getElementById("d3"), 1, {css:{left:100}});//only kills the first 2 tweens because those targets are child elements of the "d1" DOM element.TweenMax.killChildTweensOf( document.getElementById("d1") ); 
Copyright 2017, GreenSock. All rights reserved. This work is subject to theterms of useor for Club GreenSock members, the software agreement that was issued with the membership.
×