Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… adding links to Element.Measure in the Element.Dimensions docs.
  • Loading branch information
anutron committed Nov 17, 2009
1 parent 7d16ac0 commit dbbdd0d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions Docs/Element/Element.Dimensions.md
Expand Up @@ -3,10 +3,10 @@ Native: Element {#Element}

Custom Native to allow all of its methods to be used with any DOM element via the dollar function [$][].

### Note:
### Notes:

These methods don't take into consideration the body element margins and borders.
If you need margin/borders on the body, consider adding a wrapper div, but always reset the margin and borders of body to 0.
* These methods don't take into consideration the body element margins and borders. If you need margin/borders on the body, consider adding a wrapper div, but always reset the margin and borders of body to 0.
* If you need to measure the properties of elements that are not displayed (either their display style is none or one of their parents display style is none), you will need to use [Element.measure][] to expose it.

### Credits:

Expand Down Expand Up @@ -59,7 +59,9 @@ The following method is also available on the Window object.
var size = myElement.getSize();
alert("The element is "+size.x+" pixels wide and "+size.y+"pixels high.");

### Note:

If you need to measure the properties of elements that are not displayed (either their display style is none or one of their parents display style is none), you will need to use [Element.measure][] to expose it.


Element Method: getScrollSize {#Element:getScrollSize}
Expand All @@ -85,6 +87,9 @@ The following method is also available on the Window object.

- [MDC Element:scrollLeft][], [MDC Element:scrollTop][], [MDC Element:offsetWidth][], [MDC Element:offsetHeight][], [MDC Element:scrollWidth][], [MDC Element:scrollHeight][]

### Note:

If you need to measure the properties of elements that are not displayed (either their display style is none or one of their parents display style is none), you will need to use [Element.measure][] to expose it.


Element Method: getScroll {#Element:getScroll}
Expand All @@ -106,6 +111,9 @@ The following method is also available on the Window object.
var scroll = $('myElement').getScroll();
alert('My element is scrolled down ' + scroll.y + 'px'); //alerts 'My element is scrolled down to 620px'

### Note:

If you need to measure the properties of elements that are not displayed (either their display style is none or one of their parents display style is none), you will need to use [Element.measure][] to expose it.

Element Method: getPosition {#Element:getPosition}
--------------------------------------------------
Expand All @@ -132,6 +140,10 @@ relative - (Element, defaults to the document) If set, the position will be rela

- [QuirksMode: Find position](http://www.quirksmode.org/js/findpos.html)

### Note:

If you need to measure the properties of elements that are not displayed (either their display style is none or one of their parents display style is none), you will need to use [Element.measure][] to expose it.

Element Method: setPosition {#Element:setPosition}
--------------------------------------------------

Expand Down Expand Up @@ -189,6 +201,9 @@ relative - (*element*, optional) if set, the position will be relative to this e

[Element:getPosition](#Element:getPosition)

### Note:

If you need to measure the properties of elements that are not displayed (either their display style is none or one of their parents display style is none), you will need to use [Element.measure][] to expose it.

Element Method: getOffsetParent {#Element:getOffsetParent}
----------------------------------------------------------
Expand All @@ -209,4 +224,5 @@ Returns the parent of the element that is positioned, if there is one.
[MDC Element:offsetWidth]: http://developer.mozilla.org/en/docs/DOM:element.offsetWidth
[MDC Element:offsetHeight]: http://developer.mozilla.org/en/docs/DOM:element.offsetHeight
[MDC Element:scrollWidth]: http://developer.mozilla.org/en/docs/DOM:element.scrollWidth
[MDC Element:scrollHeight]: http://developer.mozilla.org/en/docs/DOM:element.scrollHeight
[MDC Element:scrollHeight]: http://developer.mozilla.org/en/docs/DOM:element.scrollHeight
[Element.measure]: /more/Element/Element.Measure

0 comments on commit dbbdd0d

Please sign in to comment.