Jump to content
GreenSock

Draggable

.applyBounds()

.applyBounds( newBounds:Object ) : Draggable

Immediately updates and applies bounds, ensuring that the target element is within the bounds (if any were defined).

Parameters

newBounds: Object

(default = null) — You may optionally supply a new bounds object (a DOM element, selector text, a generic element defining a rectangle like {top:0, left:10, width:100, height:200} or absolute values like {minX:100, minY:100, maxX:400, maxY:500}). If you’d simply like the existing bounds applied, you don’t need to supply any newBounds parameter.

Returns : Draggable

the Draggable instance itself (to make chaining possible)

 

Details

Immediately updates and applies bounds, ensuring that the target element is within the bounds (if any were defined). As a part of applying the bounds, the Draggable's x and y properties are updated as well so that they reflect the target element's current position (just like update()).

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.
×