Prototype Javascript Framework

easing the pain of dynamic web applications

  • Developer Day
  • Download
  • API Docs
  • Tips and Tutorials
  • Blog
  • Discuss
  • Contribute

Element

  • absolutize
  • addClassName
  • addMethods
  • adjacent
  • ancestors
  • childElements
  • classNames
  • cleanWhitespace
  • clonePosition
  • cumulativeOffset
  • cumulativeScrollOffset
  • descendantOf
  • descendants
  • down
  • empty
  • extend
  • fire
  • firstDescendant
  • getDimensions
  • getElementsByClassName
  • getElementsBySelector
  • getHeight
  • getOffsetParent
  • getStyle
  • getWidth
  • hasClassName
  • hide
  • identify
  • immediateDescendants
  • insert
  • inspect
  • makeClipping
  • makePositioned
  • match
  • next
  • nextSiblings
  • observe
  • positionedOffset
  • previous
  • previousSiblings
  • readAttribute
  • recursivelyCollect
  • relativize
  • remove
  • removeClassName
  • replace
  • scrollTo
  • select
  • setOpacity
  • setStyle
  • show
  • siblings
  • stopObserving
  • toggle
  • toggleClassName
  • undoClipping
  • undoPositioned
  • up
  • update
  • viewportOffset
  • visible
  • wrap
  • writeAttribute

API Docs

  • Utility Methods
  • Ajax
  • Array
  • Class
  • Date
  • Element
  • Element.Methods
  • Element.Methods.Simulated
  • Enumerable
  • Event
  • Form
  • Form.Element
  • Function
  • Hash
  • Insertion
  • Number
  • Object
  • ObjectRange
  • PeriodicalExecuter
  • Position
  • Prototype
  • String
  • Template
  • TimedObserver
  • document
  • document.viewport
  • Learn more about Prototype »

cumulativeOffset
1.6

cumulativeOffset(element) -> [Number, Number] also accessible as { left: Number, top: Number }

Returns the offsets of element from the top left corner of the document.

Adds the cumulative offsetLeft and offsetTop of an element and all its parents.

Note that all values are returned as numbers only although they are expressed in pixels.

© 2006-2007 Prototype Core Team | Licenses: MIT (source code) and CC BY-SA (documentation). mephisto-badge-tiny