%META:TOPICPARENT{name="OATDOCIndex"}%
---+ anchor.js

Enhanced Anchor tag.

%TOC%

---++ Functions

---+++ OAT.Anchor.assign(anchor, options)

Modifies anchor element so it acts like Enhanced Anchor: when activated, it displays some additional data in lookup bubble. The lookup bubble is an instance of [[OATDOCwin][OAT.Win]] object - so it can be styled the same way: use predefined OAT.Winstyles or use its own via template. Options are the following:

   * <tt> *href*</tt>  - String, url of requested data. When false,anchor inherits this value from the href attribute.
   * <tt> *connection*</tt> - <tt>OAT.Connection</tt> object
   * <tt> *datasource*</tt> -<tt>OAT.DataSource</tt> object
   * <tt> *result_control*</tt> - <tt>"grid"</tt>, <tt>"timeline"</tt> or <tt>"form"</tt>. Default is grid. Use false for common window.
   * <tt> *content*</tt> - node to be inserted (for example,<tt>OAT.Dom.text()</tt> can be used for raw text).
   * <tt> *status*</tt> - string to be inserted into status line
   * <tt> *title*</tt> - string to be in the title area of the window
   * <tt> *activation*</tt> - <tt>"hover"</tt>, <tt>"click"</tt>, <tt>"dblclick"</tt> or <tt>"focus"</tt>
   * <tt> *width*</tt> ,<tt>*height*</tt> - dimensions of lookup window (false is like 'auto' in CSS)
   * <tt> *elm*</tt> - anchor node (use when other than current)
   * <tt> *newHref*</tt> - new 'href' attribute of theanchor, defaults to 'javascript:void(0)'
   * <tt> *type*</tt> - Window style type (default <tt>OAT.WinData.RECT</tt>). (See [[OATDOCwin][OAT.Win]] for other types.)
   * <tt> *template*</tt> - custom type data. (See [[OATDOCwin][OAT.Win]] for details.)
   * <tt> *visibleButtons*</tt> - default "cr". (See [[OATDOCwin][OAT.Win]] for details.)
   * <tt> *enabledButtons*</tt> - default "cr". (See [[OATDOCwin][OAT.Win]]
  for details.)

---+++ OAT.Anchor.close(element, recursive)

Closes selected a++ window. The main point of this method is that it can be called from anywhere, so we do not have to use the close button of the window itself.

   * <tt>*element*</tt> - any element inside the a++ or the a++ container itself.
   * <tt>*recursive*</tt> - (optional) if the anchor is inside of another window, close all parents recursively.

---++ Example

<verbatim>
var options = {
        title:"Title text",
        content:OAT.Dom.text("Content text"),
        status:"Status text",
        result_control:false,
        activation: "hover",
        type:OAT.WinData.TYPE_MAC
}
OAT.Anchor.assign("elementID", options);
</verbatim>

CategoryDocumentation CategoryOAT CategoryOpenSource