diff --git a/src/dom/dom.js b/src/dom/dom.js index 48d255f..ec3631c 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -1286,15 +1286,60 @@ Element.Methods = { /** * Element.clonePosition(@element, source[, options]) -> Element + * - source (Element | String): The source element (or its ID). + * - options (Object): The position fields to clone. * - * Clones the position and/or dimensions of `source` onto `element` as - * defined by `options`. + * Clones the position and/or dimensions of `source` onto the element as + * defined by `options`, with an optional offset for the `left` and `top` + * properties. * - * Valid keys for `options` are: `setLeft`, `setTop`, `setWidth`, and - * `setHeight` (all booleans which default to `true`); and `offsetTop` - * and `offsetLeft` (numbers which default to `0`). Use these to control - * which aspects of `source`'s layout are cloned and how much to offset - * the resulting position of `element`. + * Note that the element will be positioned exactly like `source` whether or + * not it is part of the same [CSS containing + * block](http://www.w3.org/TR/CSS21/visudet.html#containing-block-details). + * + * ##### Options + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
NameDefaultDescription
setLefttrueClones source's left CSS property onto element.
setToptrueClones source's top CSS property onto element.
setWidthtrueClones source's width onto element.
setHeighttrueClones source's width onto element.
offsetLeft0Number by which to offset element's left CSS property.
offsetTop0Number by which to offset element's top CSS property.
**/ clonePosition: function(element, source) { var options = Object.extend({