JSAPI.info

dojo.contentBox

Dojo (1.6.1) - see full source
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
dojo.contentBox = function(/*DomNode|String*/node, /*Object?*/box){
    //    summary:
    //        Getter/setter for the content-box of node.
    //    description:
    //        Returns an object in the expected format of box (regardless if box is passed).
    //        The object might look like:
    //            `{ l: 50, t: 200, w: 300: h: 150 }`
    //        for a node offset from its parent 50px to the left, 200px from
    //        the top with a content width of 300px and a content-height of
    //        150px. Note that the content box may have a much larger border
    //        or margin box, depending on the box model currently in use and
    //        CSS values set/inherited for node.
    //        While the getter will return top and left values, the
    //        setter only accepts setting the width and height.
    //    node:
    //        id or reference to DOM Node to get/set box for
    //    box:
    //        If passed, denotes that dojo.contentBox() should
    //        update/set the content box for node. Box is an object in the
    //        above format, but only w (width) and h (height) are supported.
    //        All properties are optional if passed.
    var n = byId(node), s = gcs(n), b = box;
    return !b ? d._getContentBox(n, s) : d._setContentSize(n, b.w, b.h, s); // Object
};