The goog.dom.NodeOffset Class

goog.dom.NodeOffset
> goog.Disposable

goog.dom.NodeOffset(node, baseNode)

Object to store the offset from one node to another in a way that works on any similar DOM structure regardless of whether it is the same actual nodes.

node {Node}
The node to get the offset for.
baseNode {Node}
The node to calculate the offset from.

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.findTargetNode(baseNode)

Walk the dom and find the node relative to baseNode. Returns null on failure.

baseNode {Node}
The node to start walking from. Should be equivalent to the node passed in to the constructor, in that it should have the same contents.
returns {Node}
The node relative to baseNode, or null on failure.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.toString()

returns {string}
A string representation of this object.